From b36f35ec5ad8fb7a602c33d56732c47c818c7864 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 15 Jan 2013 11:15:26 +0200 Subject: [PATCH] Always measure errorMessage to get a resize event when it is removed (#10589) Change-Id: Id0f477fcc8702b07289f2234073e7c95fd90c01f --- .../vaadin/client/ui/form/FormConnector.java | 22 +++++++------------ 1 file 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 @@ -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); } -- 2.39.5