From: Artur Signell Date: Wed, 14 Mar 2012 13:05:36 +0000 (+0200) Subject: Do not create a new stack item on every tab change, reuse the existing X-Git-Tag: 7.0.0.alpha2~322 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=16283d8e7d485709a048717c0854aebd31732343;p=vaadin-framework.git Do not create a new stack item on every tab change, reuse the existing by removing its widget --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VAccordion.java b/src/com/vaadin/terminal/gwt/client/ui/VAccordion.java index 95db322730..e225895995 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VAccordion.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VAccordion.java @@ -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 {