This content has been marked as final.
Show 1 reply
-
1. Re: Tree : Expand All
ronanker Mar 31, 2008 4:25 AM (in response to enda)"tomahawk tree2 is able to open expand all tree"...
not so easy, nearly a hack to do this... or maybe there's a new way of doing it that i don't know ?
for rich:tree, i don't know but with rich:(recursiveT|t)reeNodesAdaptor i manage to do it.
I've got my own tree structure that contains a "isExpended" boolean on nodes (here named "isDeplie"),//adviseNodeOpened="#{handler.adviseNodeOpened}" public Boolean adviseNodeOpened(UITree tree) { BeanNoeud bn = (BeanNoeud)tree.getRowData(); if (bn==null) { return Boolean.TRUE; } return new Boolean(bn.isDeplie()); } //changeExpandListener="#{handler.processExpansion}" public void processExpansion(NodeExpandedEvent event) throws AbortProcessingException { HtmlTree arbre = (HtmlTree)event.getSource(); BeanNoeud bn = (BeanNoeud)arbre.getRowData(); if (bn.isDeplie()) { bn.setDeplie(false); }else{ bn.setDeplie(true); } }
I don't think this is a solution to do, but if you already have a tree structure and just want to now use richfaces tree to render it, this way seems quite cool :-)