From 16283d8e7d485709a048717c0854aebd31732343 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Wed, 14 Mar 2012 15:05:36 +0200 Subject: [PATCH] Do not create a new stack item on every tab change, reuse the existing by removing its widget --- src/com/vaadin/terminal/gwt/client/ui/VAccordion.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 { -- 2.39.5