]> source.dussan.org Git - vaadin-framework.git/commitdiff
Merged fix for #2839 - Form should not measure borders before style names are set.
authorArtur Signell <artur.signell@itmill.com>
Thu, 9 Apr 2009 13:04:37 +0000 (13:04 +0000)
committerArtur Signell <artur.signell@itmill.com>
Thu, 9 Apr 2009 13:04:37 +0000 (13:04 +0000)
svn changeset:7382/svn branch:6.0

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

index 0b91268d251f4e3675258793ecbe65a0f859dcd6..1639b6693b1725d6110976e34cfbc9a8a3e713b3 100644 (file)
@@ -75,11 +75,10 @@ public class IForm extends ComplexPanel implements Container {
 \r
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {\r
         rendering = true;\r
-\r
+        boolean measure = false;\r
         if (this.client == null) {\r
             this.client = client;\r
-            borderPaddingVertical = getOffsetHeight();\r
-            borderPaddingHorizontal = getOffsetWidth() - desc.getOffsetWidth();\r
+            measure = true;\r
         }\r
 \r
         if (client.updateComponent(this, uidl, false)) {\r
@@ -87,6 +86,14 @@ public class IForm extends ComplexPanel implements Container {
             return;\r
         }\r
 \r
+        if (measure) {\r
+            // Measure the border when the style names have been set\r
+            borderPaddingVertical = getOffsetHeight();\r
+            int ow = getOffsetWidth();\r
+            int dow = desc.getOffsetWidth();\r
+            borderPaddingHorizontal = ow - dow;\r
+        }\r
+\r
         boolean legendEmpty = true;\r
         if (uidl.hasAttribute("caption")) {\r
             DOM.setInnerText(caption, uidl.getStringAttribute("caption"));\r