From: Marc Englund Date: Fri, 27 Jun 2008 09:50:13 +0000 (+0000) Subject: Error indicator changed position in some instances. Fixes #1854 X-Git-Tag: 6.7.0.beta1~4548 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=185d1d6078fd82f72f9efe1b63e9bbedd9aa37ce;p=vaadin-framework.git Error indicator changed position in some instances. Fixes #1854 svn changeset:4962/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/Caption.java b/src/com/itmill/toolkit/terminal/gwt/client/Caption.java index 5d9cd6ff18..bab2b6e06c 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/Caption.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/Caption.java @@ -47,22 +47,6 @@ public class Caption extends HTML { boolean isEmpty = true; - if (uidl.hasAttribute("error")) { - isEmpty = false; - if (errorIndicatorElement == null) { - errorIndicatorElement = DOM.createDiv(); - if (Util.isIE()) { - DOM.setInnerHTML(errorIndicatorElement, " "); - } - DOM.setElementProperty(errorIndicatorElement, "className", - "i-errorindicator"); - DOM.appendChild(getElement(), errorIndicatorElement); - } - } else if (errorIndicatorElement != null) { - DOM.removeChild(getElement(), errorIndicatorElement); - errorIndicatorElement = null; - } - if (uidl.hasAttribute("icon")) { if (icon == null) { icon = new Icon(client); @@ -105,7 +89,7 @@ public class Caption extends HTML { } if (uidl.getBooleanAttribute("required")) { - isEmpty = false; + isEmpty = false; if (requiredFieldIndicator == null) { requiredFieldIndicator = DOM.createSpan(); DOM.setInnerText(requiredFieldIndicator, "*"); @@ -120,6 +104,22 @@ public class Caption extends HTML { } } + if (uidl.hasAttribute("error")) { + isEmpty = false; + if (errorIndicatorElement == null) { + errorIndicatorElement = DOM.createDiv(); + if (Util.isIE()) { + DOM.setInnerHTML(errorIndicatorElement, " "); + } + DOM.setElementProperty(errorIndicatorElement, "className", + "i-errorindicator"); + DOM.appendChild(getElement(), errorIndicatorElement); + } + } else if (errorIndicatorElement != null) { + DOM.removeChild(getElement(), errorIndicatorElement); + errorIndicatorElement = null; + } + // Workaround for IE weirdness, sometimes returns bad height in some // circumstances when Caption is empty. See #1444 // IE7 bugs more often. I wonder what happens when IE8 arrives...