From 185d1d6078fd82f72f9efe1b63e9bbedd9aa37ce Mon Sep 17 00:00:00 2001 From: Marc Englund Date: Fri, 27 Jun 2008 09:50:13 +0000 Subject: [PATCH] Error indicator changed position in some instances. Fixes #1854 svn changeset:4962/svn branch:trunk --- .../toolkit/terminal/gwt/client/Caption.java | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) 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... -- 2.39.5