This content has been marked as final.
Show 4 replies
-
1. Re: RichFaces Tree: How to
cosminj Mar 17, 2008 8:38 AM (in response to cosminj)I have been trying without success, to use queueNodeExpand on the UITree, based on the user input.
The "goto" action method is something like:public void gotoAction(ActionEvent ae) { HtmlTree htmlTree = null; HtmlInputText input = null; HtmlAjaxCommandButton button = (HtmlAjaxCommandButton) ae.getSource(); HtmlForm htmlForm = (HtmlForm) button.getParent(); for(UIComponent component : htmlForm.getChildren()) { if(component instanceof HtmlTree) { htmlTree = (HtmlTree) component; } else if(component instanceof HtmlInputText) { input = (HtmlInputText) component; } } String val = "" + input.getSubmittedValue(); // manually expand now TreeRowKey trk = new ListRowKey(htmlTree.getId()+":" + val); try { htmlTree.queueNodeExpand(trk); } catch(IOException e) { log.error(e, e); } }
The goal of the above code:
- expand node with TreeRowKey equals to the one calculated as path=TREE_ID:NODE_IDENTIFIER.
I deducted this info from looking with the debugger to the TreeRowKeys of other rendered nodes.
Could anyone please help me on this matter, or let me know why isn't queueNodeExpanded working as expected?
P.S.: The equals() implementation of TreeRowKey is based on path.equals() so this logic should work correctly.
What am I missing? -
2. Re: RichFaces Tree: How to
cosminj Mar 26, 2008 6:13 AM (in response to cosminj)Please, does anybody have a working example of a simple rich:tree which can be expanded based on a Node Identifier (TreeRowKey) ?
Thank you,
Cosmin. -
3. Re: RichFaces Tree: How to
antonovici Mar 27, 2008 4:48 AM (in response to cosminj)Salut,
http://labs.jboss.com/wiki/ExpandCollapseTreeNodes
I tryed that and is working for me using adviseNodeOpened attribute.
Bafta -
4. Re: RichFaces Tree: How to
cosminj Mar 27, 2008 9:38 AM (in response to cosminj)Merci,
I'll look into it.