Thanks Christopher, I got the idea, but this is where I am really struggling. Together with executing the action associated with the node, I have to change its styleclass to reflect that it was as if the node was clicked. To achieve that using the normal way, my command link has this:
<a4j:commandLink id="a4jLink" styleClass="#{t.nodeSelected? 'documentSelected':'document'}" action="#{treeBacker.processFolder}" actionListener="#{t.setNodeSelected}" reRender="a4jGroup" > To do that programmatically, I think I have to invoke the setNodeSelected in the backing bean, the problem now is the setNodeSelected is associated with an ActionEvent, I dont have an ActionEvent object because there was no actual action that generates the event , I'm just simulating the "event" programmatically. Any more hints?... Christopher Cudennec wrote: > > Hi there, > > you could implement your own TreeNode adding a new method "onClick" (or > whatsoever) that can be called when you found the match in your backing > bean. Does that solve your problem? (Look here for a start: > http://myfaces.apache.org/tomahawk/apidocs/org/apache/myfaces/custom/tree2/TreeNodeBase.html) > > Cheers, > > Christopher > > kewldude schrieb: >> Here goes the situation, I have a textbox that can search through the >> nodes >> in the tree2 component. When there is a match, I need to expand the >> specific >> node. I can do that part no problem. But together with expanding that >> node, >> the action associated to that node should also be executed (it was as if >> that node was clicked), how can I do that? or is it possible to do that >> all? >> any hints...thanks. >> > > > -- View this message in context: http://www.nabble.com/Tree2---Selecting-a-node-programmatically-tf4279246.html#a12194803 Sent from the MyFaces - Users mailing list archive at Nabble.com.