This content has been marked as final.
Show 1 reply
-
1. Re: rich:tree question, how to select a tree node and how to
vh Jul 19, 2007 8:22 PM (in response to vh)I use the binding to bind my tree to my bean. and I did the following to select a specific tree node.
public void expandTemplateTree(ActionEvent evt) { try { TreeState ts = (TreeState)templateTree.getComponentState(); ts.expandAll(); ListRowKey key = getRowKey(templateRoot, this.templatePath); boolean is = ts.isSelected(key); boolean result = ts.setSelected(key); is = ts.isSelected(key); ts.saveState( FacesContext.getCurrentInstance() ); //this.templateTree.queueExpandAll(); } catch (IOException e) { e.printStackTrace(); } }
I can see that after ts.setSelected(key);
the ts.isSelected(key) returned "true",
but after reRender the tree, the tree is expanded but the tree node is not shown as selected.
Please help.