if (filteredChildren != null) {
filteredChildren = null;
}
+ if (filteredParent != null) {
+ filteredParent = null;
+ }
}
enableAndFireContentsChangeEvents();
return success;
}
}
parent.remove(itemId);
+ if (filteredParent != null) {
+ // Item id no longer has a parent as the item id is not in the
+ // container.
+ filteredParent.remove(itemId);
+ }
noChildrenAllowed.remove(itemId);
}
testContainerSortingAndFiltering(new HierarchicalContainer());\r
}\r
\r
+ public void testRemovingItemsFromFilteredContainer() {\r
+ HierarchicalContainer container = new HierarchicalContainer();\r
+ initializeContainer(container);\r
+ container.setIncludeParentsWhenFiltering(true);\r
+ container.addContainerFilter(FULLY_QUALIFIED_NAME, "ab", false, false);\r
+ Object p1 = container.getParent("com.vaadin.ui.TabSheet");\r
+ assertEquals("com.vaadin.ui", p1);\r
+\r
+ container.removeItem("com.vaadin.ui.TabSheet");\r
+ // Parent for the removed item must be null because the item is no\r
+ // longer in the container\r
+ p1 = container.getParent("com.vaadin.ui.TabSheet");\r
+ assertNull("Parent should be null, is " + p1, p1);\r
+\r
+ container.removeAllItems();\r
+ p1 = container.getParent("com.vaadin.terminal.gwt.client.Focusable");\r
+ assertNull("Parent should be null, is " + p1, p1);\r
+\r
+ }\r
+\r
public void testHierarchicalFilteringWithParents() {\r
HierarchicalContainer container = new HierarchicalContainer();\r
initializeContainer(container);\r