]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes to iformlayout
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 20 May 2008 10:07:05 +0000 (10:07 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 20 May 2008 10:07:05 +0000 (10:07 +0000)
svn changeset:4563/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IFormLayout.java

index fc1d6c3b80f4f1b60ff08f686afc3df2fa35a843..0d590255875196dc6e046d3d8f764d6a2a4a7e33 100644 (file)
@@ -27,6 +27,7 @@ public class IFormLayout extends FlexTable implements Container {
 
     HashMap componentToCaption = new HashMap();
     private ApplicationConnection client;
+    private HashMap componentToError = new HashMap();
 
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
         this.client = client;
@@ -45,6 +46,11 @@ public class IFormLayout extends FlexTable implements Container {
                 c = new Caption(p, client);
                 componentToCaption.put(p, c);
             }
+            ErrorFlag error = (ErrorFlag) componentToError.get(p);
+            if (error == null) {
+                error = new ErrorFlag();
+                componentToError.put(p, error);
+            }
             final Paintable oldComponent = (Paintable) getWidget(i, 1);
             if (oldComponent == null) {
                 setWidget(i, 1, (Widget) p);
@@ -53,16 +59,13 @@ public class IFormLayout extends FlexTable implements Container {
                 setWidget(i, 1, (Widget) p);
             }
             setWidget(i, 0, c);
-            p.updateFromUIDL(childUidl, client);
 
             prepareCell(i, 2);
             getCellFormatter().setStyleName(i, 2, "i-formlayout-errorcell");
-            ErrorFlag error = (ErrorFlag) getWidget(i, 2);
-            if (error == null) {
-                error = new ErrorFlag();
-                setWidget(i, 2, error);
-            }
-            error.updateFromUIDL(childUidl);
+            setWidget(i, 2, error);
+
+            p.updateFromUIDL(childUidl, client);
+
         }
 
         while (getRowCount() > i) {
@@ -96,6 +99,10 @@ public class IFormLayout extends FlexTable implements Container {
         if (c != null) {
             c.updateCaption(uidl);
         }
+        final ErrorFlag e = (ErrorFlag) componentToError.get(component);
+        if (e != null) {
+            e.updateFromUIDL(uidl);
+        }
     }
 
     public class Caption extends HTML {