-
1. RF4 tree/treenode select a specific node
jonask May 2, 2011 2:38 AM (in response to jonask)anyone an idea?
-
2. RF4 tree/treenode select a specific node
lfryc May 2, 2011 8:16 AM (in response to jonask)Hi Jonas,
you could design backing bean which will contain:
private Collection<? extends Serializable> selection; // + getters / setters
and then point your tree to this collection by selection="#{backingBean.selection}".
Regards,
- Lukas
-
3. RF4 tree/treenode select a specific node
jonask May 2, 2011 8:27 AM (in response to lfryc)thanks for the answer. i pointed my tree to the selection, like you suggested.
How can i now access my nodes? are they in the collection? type TreeNode?
-
4. RF4 tree/treenode select a specific node
nbelaevski May 2, 2011 4:14 PM (in response to jonask)Hi Jonas,
No, this collection contains model keys of nodes.
-
5. Re: RF4 tree/treenode select a specific node
jonask May 3, 2011 2:36 AM (in response to nbelaevski)so what to do with it?
I'm still stuck at this...
I managed to access my tree via RichFunction:
UIComponent component = org.richfaces.function.RichFunction.findComponent("tree"); UITree tree = (UITree)component;
But i still dont know, how to tell him which node to select...
-
6. Re: RF4 tree/treenode select a specific node
ilya_shaikovsky May 3, 2011 8:45 AM (in response to jonask)you should not deal with the component itself. you should get the model used and get the rowKey for the node which should be selected than add that rowKey to the collection. If will not be able to solve please show the model code.
-
7. RF4 tree/treenode select a specific node
jonask May 3, 2011 9:11 AM (in response to ilya_shaikovsky)just solved it!
i created a new rowkey
newKey = new SequenceRowKey(new Integer(0));
and then set it in a collection to the tree
Collection<Object> map = new HashSet<Object>();
map.add(newKey);
tree.setSelection(map);
works good is this the right way?
-
8. RF4 tree/treenode select a specific node
jonask May 4, 2011 10:58 AM (in response to jonask)I came to the point where i have to go through the whole tree. (at BeanSide)
how can i iterate through it or is it even possible??
i want to first go as deep as possible and then part by part...
Thanks!
-
9. RF4 tree/treenode select a specific node
nbelaevski May 4, 2011 11:03 AM (in response to jonask)Jonas,
To iterate through teh whole tree you can use walk(...) method.