]> source.dussan.org Git - vaadin-framework.git/commitdiff
Always measure errorMessage to get a resize event when it is removed (#10589) 46/646/1
authorArtur Signell <artur@vaadin.com>
Tue, 15 Jan 2013 09:15:26 +0000 (11:15 +0200)
committerArtur Signell <artur@vaadin.com>
Tue, 15 Jan 2013 09:15:26 +0000 (11:15 +0200)
Change-Id: Id0f477fcc8702b07289f2234073e7c95fd90c01f

client/src/com/vaadin/client/ui/form/FormConnector.java

index 61a38e74ba81d42e2826ee79aa5f31aed52f8282..b87faf7b302c067ecc19716a981db7a3453d5eca 100644 (file)
@@ -71,13 +71,17 @@ public class FormConnector extends AbstractComponentContainerConnector
         }
     };
 
+    @Override
+    protected void init() {
+        getLayoutManager().addElementResizeListener(
+                getWidget().errorMessage.getElement(), footerResizeListener);
+    };
+
     @Override
     public void onUnregister() {
         VForm form = getWidget();
-        if (form.errorMessage.isVisible()) {
-            getLayoutManager().removeElementResizeListener(
-                    form.errorMessage.getElement(), footerResizeListener);
-        }
+        getLayoutManager().removeElementResizeListener(
+                form.errorMessage.getElement(), footerResizeListener);
         if (form.footer != null) {
             getLayoutManager().removeElementResizeListener(
                     form.footer.getElement(), footerResizeListener);
@@ -125,18 +129,8 @@ public class FormConnector extends AbstractComponentContainerConnector
 
         if (null != getState().errorMessage) {
             getWidget().errorMessage.updateMessage(getState().errorMessage);
-            if (!getWidget().errorMessage.isVisible()) {
-                getLayoutManager().addElementResizeListener(
-                        getWidget().errorMessage.getElement(),
-                        footerResizeListener);
-            }
             getWidget().errorMessage.setVisible(true);
         } else {
-            if (getWidget().errorMessage.isVisible()) {
-                getLayoutManager().removeElementResizeListener(
-                        getWidget().errorMessage.getElement(),
-                        footerResizeListener);
-            }
             getWidget().errorMessage.setVisible(false);
         }