Re: T5.3.1 How to expand all the tree nodes?
public void onExpandAll() { TreeExpansionModel expansionModel = tree.getExpansionModel(); ListTreeNode roots = getTreeModel().getRootnodes(); for (TreeNode root : roots) { expandAll(root); } } private void expandAll(TreeNode node) { if (node.getHasChildren()) { expansionModel.markExpanded(node); for (TreeNode child : node.getChildren()) { expandAll(child); // this is a recursive call } } } -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-1-How-to-expand-all-the-tree-nodes-tp5702736p5708713.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.3.1 How to expand all the tree nodes?
Hi Lance, Thanks for the pointer, works great, thank you very much -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-1-How-to-expand-all-the-tree-nodes-tp5702736p5708795.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.3.1 How to expand all the tree nodes?
hi Lance, can you give me an idea on recursive calling on this tree's deeply nested object recursive call? i just can't think of the way to this recursively, please advice and easy example would be helpful. thank you -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-1-How-to-expand-all-the-tree-nodes-tp5702736p5708646.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.3.1 How to expand all the tree nodes?
Page.tml t:tree t:id=tree t:model=treeModel / Page.java - @InjectComponent Tree tree; @Cached // use cached because this method may be called twice in a single request public TreeModel getTreeModel() { ... } public void onExpandAll() { TreeExpansionModel expansionModel = tree.getExpansionModel(); ListTreeNode roots = getTreeModel().getRootnodes(); // recursively iterate the TreeNodes starting at the roots and call TreeExpansionModel.markExpanded(node); } -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-1-How-to-expand-all-the-tree-nodes-tp5702736p5702872.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org