diff options
author | Artur Signell <artur@vaadin.com> | 2013-01-15 11:15:26 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2013-01-15 11:15:26 +0200 |
commit | b36f35ec5ad8fb7a602c33d56732c47c818c7864 (patch) | |
tree | e448c6e964f8a76546ef3d086fe85db5e3fbe40c | |
parent | f5f8ee2494cc6614420391adb9f1cb730fd795d9 (diff) | |
download | vaadin-framework-b36f35ec5ad8fb7a602c33d56732c47c818c7864.tar.gz vaadin-framework-b36f35ec5ad8fb7a602c33d56732c47c818c7864.zip |
Always measure errorMessage to get a resize event when it is removed (#10589)
Change-Id: Id0f477fcc8702b07289f2234073e7c95fd90c01f
-rw-r--r-- | client/src/com/vaadin/client/ui/form/FormConnector.java | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/client/src/com/vaadin/client/ui/form/FormConnector.java b/client/src/com/vaadin/client/ui/form/FormConnector.java index 61a38e74ba..b87faf7b30 100644 --- a/client/src/com/vaadin/client/ui/form/FormConnector.java +++ b/client/src/com/vaadin/client/ui/form/FormConnector.java @@ -72,12 +72,16 @@ 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); } |