]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed widget comparisons to avoid reattaching children (#9807) 52/252/2
authorArtur Signell <artur@vaadin.com>
Mon, 12 Nov 2012 17:56:24 +0000 (19:56 +0200)
committerArtur Signell <artur@vaadin.com>
Tue, 13 Nov 2012 07:53:01 +0000 (09:53 +0200)
Change-Id: Iae6de2bf3d6cbc39fc2b6285eb1e514710e98818

client/src/com/vaadin/client/ui/accordion/VAccordion.java

index ce973f96300ef9011b3472344e237a9294b0549b..70398c238f7239556038b09708336e8fa61374f4 100644 (file)
@@ -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;