From 5323d619a769cb73fdcb52e07a2e67451a3dc4e8 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 12 Nov 2012 19:56:24 +0200 Subject: Fixed widget comparisons to avoid reattaching children (#9807) Change-Id: Iae6de2bf3d6cbc39fc2b6285eb1e514710e98818 --- client/src/com/vaadin/client/ui/accordion/VAccordion.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/client/src/com/vaadin/client/ui/accordion/VAccordion.java b/client/src/com/vaadin/client/ui/accordion/VAccordion.java index ce973f9630..70398c238f 100644 --- a/client/src/com/vaadin/client/ui/accordion/VAccordion.java +++ b/client/src/com/vaadin/client/ui/accordion/VAccordion.java @@ -131,7 +131,7 @@ public class VAccordion extends VTabsheetBase { Widget itemWidget = item.getComponent(); if (tabContent != null) { - if (tabContent != itemWidget) { + if (tabContent.getWidget() != itemWidget) { /* * This is not the same widget as before, find out if it has * been moved @@ -542,8 +542,14 @@ public class VAccordion extends VTabsheetBase { @Override protected ComponentConnector getTab(int index) { if (index < getWidgetCount()) { - Widget w = getStackItem(index); - return ConnectorMap.get(client).getConnector(w); + StackItem stackItem = getStackItem(index); + if (stackItem == null) { + return null; + } + Widget w = stackItem.getChildWidget(); + if (w != null) { + return ConnectorMap.get(client).getConnector(w); + } } return null; -- cgit v1.2.3