-
1. How to display a tree with particular nodes expanded by default
ilya40umov Feb 2, 2011 11:09 AM (in response to roy433)I think that you should try
TreeStateAdvisor
Look at the following links for more information:
-
2. Re: How to display a tree with particular nodes expanded by default
roy433 Feb 2, 2011 10:58 PM (in response to roy433)public class TreeDemoStateAdvisor implements TreeStateAdvisor {
public Boolean adviseNodeOpened(UITree tree) {
if (!PostbackPhaseListener.isPostback()) {
Object key = tree.getRowKey();
TreeRowKey treeRowKey = (TreeRowKey) key;
if (treeRowKey == null || treeRowKey.depth() <= 2) {
return Boolean.TRUE;
}
}
return null;
}
public Boolean adviseNodeSelected(UITree tree) {
return null;
}
1)when does and how many times adviseNodeOpened (UITree tree) called?
2)looks like this
treeRowKey.depth() <= 2 will display a tree of depth 2 levels of nodes but I have to display a tree of 2 or 3 level of nodes
-
3. Re: How to display a tree with particular nodes expanded by default
ilya40umov Feb 2, 2011 2:32 PM (in response to roy433)1) on every tree rendering I guess
2) you are free to modify this method for your own business logic
P.S. Look at treeNodesAdaptor exaple from Richfaces Live Demo more close. It completely shows usage of TreeStateAdvisor.