This content has been marked as final.
Show 1 reply
-
1. Re: RF 4.1-M4 Programmatically set Tree node
jsoye Nov 24, 2011 5:26 PM (in response to jsoye)Oops. I missed spotting the "selection" attribute in <rich:tree>. This was the answer. Just point it at the collection, i.e.
<rich:tree id="myTree" ... selection="#{treeBean.treeSelection}">
</rich:tree>
@Stateful
@Named
@ConversationScoped
public class TreeBean implements java.io.Serializable {
private Collection<Object> treeSelection = new ArrayList<Object>(); // plus getters & setters
...
public void promoteNode() {
Integer sortOrder = myNode.getSortOrder();
SequenceRowKey srk = new SequenceRowKey("root","S"+ (sortOrder.intValue()-1) );
...
Collection<Object> collection = new ArrayList<Object>();
collection.add(srk);
setTreeSelection(collection);
}
}