diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-11-07 10:50:14 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-11-09 09:41:31 +0200 |
commit | ed73e06bb76666788c187741d574c99947bcf69c (patch) | |
tree | 2bee9eec6639dcc58ab285a58d5fd5f7875d5874 | |
parent | 3a3cac2db68544a7abc5e0c9673cce1b1fa5aaf4 (diff) | |
download | vaadin-framework-ed73e06bb76666788c187741d574c99947bcf69c.tar.gz vaadin-framework-ed73e06bb76666788c187741d574c99947bcf69c.zip |
Verify child info in state before attaching widgets (#10150)
Change-Id: If6677bd1fcfc6dadd09d5816b93a0206417facb3
-rw-r--r-- | client/src/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/client/src/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java b/client/src/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java index a4aac4fea3..aa14492849 100644 --- a/client/src/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java +++ b/client/src/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java @@ -210,15 +210,23 @@ public abstract class AbstractSplitPanelConnector extends @Override public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { + /* + * When the connector gets detached, the state isn't updated but there's + * still a hierarchy change -> verify that the child from the state is + * still our child before attaching the widget. See #10150. + */ + Widget newFirstChildWidget = null; - if (getFirstChild() != null) { - newFirstChildWidget = getFirstChild().getWidget(); + ComponentConnector firstChild = getFirstChild(); + if (firstChild != null && firstChild.getParent() == this) { + newFirstChildWidget = firstChild.getWidget(); } getWidget().setFirstWidget(newFirstChildWidget); Widget newSecondChildWidget = null; - if (getSecondChild() != null) { - newSecondChildWidget = getSecondChild().getWidget(); + ComponentConnector secondChild = getSecondChild(); + if (secondChild != null && secondChild.getParent() == this) { + newSecondChildWidget = secondChild.getWidget(); } getWidget().setSecondWidget(newSecondChildWidget); } |