]> source.dussan.org Git - vaadin-framework.git/commitdiff
Error indicator changed position in some instances. Fixes #1854
authorMarc Englund <marc.englund@itmill.com>
Fri, 27 Jun 2008 09:50:13 +0000 (09:50 +0000)
committerMarc Englund <marc.englund@itmill.com>
Fri, 27 Jun 2008 09:50:13 +0000 (09:50 +0000)
svn changeset:4962/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/Caption.java

index 5d9cd6ff18b2469722e09338c73f240eaee41eac..bab2b6e06c664b9629f5ba12d4055ef6ed6518c2 100644 (file)
@@ -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, "&nbsp;");
-                }
-                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, "&nbsp;");
+                }
+                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...