-
1. Re: rich:tree selected node value on client side
ilya40umov Jan 7, 2011 2:09 AM (in response to anonyin)1) You can handle every user selection and save it on server. Like this
http://livedemo.exadel.com/richfaces-demo/richfaces/tree.jsf?tab=model&cid=1197527
2) You can handle every user selection by onselected event and save selected node in JS variable. It could look like this:
onselected="handleSelectionJSFunction(#{treeItem.id});"
-
2. rich:tree selected node value on client side
anonyin Jan 7, 2011 5:31 PM (in response to ilya40umov)Thanks for the reply.
onselected will give me the value when we click on the tree node, yes I could certainly capture it on server side by passing the selected node value to the refresh function below. Infact I'm doing it.
<a4j:jsFunction name="refresh"
action="#"
reRender="data">
<a4j:actionparam name="param1" assignTo="#{bean.treeNodeId}" />
</a4j:jsFunction>
But when I click on another action(Say Search) in the page(this link/button is not part of the tree its outside the tree) I want the value of the last tree node selected before clicking Search button to be passed to my bean. Eventhough I set the value of the treeNodeId in the bean when click on the tree node, by the time I click on the search button that value is lost.
Any otherways to acheive this will also help.
Thanks.
-
3. rich:tree selected node value on client side
ilya40umov Jan 7, 2011 5:39 PM (in response to anonyin)Look at the following link:
http://community.jboss.org/thread/158981
I guess you need to pass selectedNodeId in actionparam inside a4j:commandButton - Search button.
P.S. Make sure that you do save selectedNodeId in a JS variable. Use alert command or debug your JS in firebug.