CONTENTS_CHANGED event doesn't work well when the node has children as the new content. When TreeViewStateSnapshot.openIfRequired(Treeitem) tries to open the previously opened element, the associated Treeitem has the _loaded property set to true. As you can see in [1] this avoids the children to be rendered. Instead a INTERVAL_REMOVED and INTERVAL_ADDED are fired so the the Treeitems for the elements moved are removed and recreated completely avoiding that problem. This introduces a new issue: the node loses its selection status but can be fixed using a similar approach to TreeViewStateSnapshot. [1] org.zkoss.zul.Tree.renderItem0(Renderer, Treeitem, Object) |
||
|---|---|---|
| .. | ||
| src | ||
| pom.xml | ||