From b8ae4fc242495cc805ac931d708c918893c06183 Mon Sep 17 00:00:00 2001 From: Johannes Tuikkala Date: Mon, 12 Jan 2015 10:18:42 +0200 Subject: Fix for: TreeTable with ContainerHierarchicalWrapper not correctly displaying child items (#15421) Change-Id: Iadf1faa979fbae412b55551c6622b0429039a21c --- .../com/vaadin/data/util/ContainerHierarchicalWrapper.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'server/src/com/vaadin/data') diff --git a/server/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java b/server/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java index 0bfec33957..199d186fab 100644 --- a/server/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java +++ b/server/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java @@ -450,6 +450,8 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, // Update parent parent.remove(itemId); + fireItemSetChangeIfAbstractContainer(); + return true; } @@ -490,9 +492,21 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, } } + fireItemSetChangeIfAbstractContainer(); + return true; } + /** + * inform container (if it is instance of AbstractContainer) about the + * change in hierarchy (#15421) + */ + private void fireItemSetChangeIfAbstractContainer() { + if (container instanceof AbstractContainer) { + ((AbstractContainer) container).fireItemSetChange(); + } + } + /** * Creates a new Item into the Container, assigns it an automatic ID, and * adds it to the hierarchy. -- cgit v1.2.3