]> source.dussan.org Git - vaadin-framework.git/commitdiff
Do not create a new stack item on every tab change, reuse the existing
authorArtur Signell <artur@vaadin.com>
Wed, 14 Mar 2012 13:05:36 +0000 (15:05 +0200)
committerArtur Signell <artur@vaadin.com>
Wed, 14 Mar 2012 14:01:24 +0000 (16:01 +0200)
by removing its widget

src/com/vaadin/terminal/gwt/client/ui/VAccordion.java

index 95db3227305cf2921303677c2ee732bfa77f9deb..e225895995084840d5b276487baeefd021cb7c46 100644 (file)
@@ -128,8 +128,7 @@ public class VAccordion extends VTabsheetBase {
             // StackItem
             Widget oldWidget = item.getComponent();
             if (oldWidget != null) {
-                item = new StackItem(tabUidl);
-                insert(item, getElement(), newIndex, true);
+                oldWidget.removeFromParent();
             }
         }
         return item;
@@ -262,7 +261,8 @@ public class VAccordion extends VTabsheetBase {
     }
 
     /**
-     *
+     * A StackItem has always two children, Child 0 is a VCaption, Child 1 is
+     * the actual child widget.
      */
     protected class StackItem extends ComplexPanel implements ClickHandler {