You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Eric Hsieh <ec...@yahoo.com> on 2005/03/24 19:59:37 UTC

Another tree2 question

Along the same lines as my earlier question regarding
current node selection (Thanks Matthias for forwarding
Sean's answer!), is there any way to remotely set the
currently selected node in the tree?

My scenario is the following: from a popup window I'm
adding a new element to the db.  This element will
appear in the tree in the main window whenever the
tree refreshes.  I want the element that was just
added to be selected once the tree refreshes. 
Possible?

FYI, I'm creating a tree of TreeNodeBase nodes.  Could
I look up the object populating <x:tree2 value=""> and
set a selected flag on one of the nodes?


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

Re: Another tree2 question

Posted by Sean Schofield <se...@gmail.com>.
Eric,

Right now the selected node is set through the ActionListener
mechanism.  Your popup window can't really interract with the tree in
this manner (at least the way the tree is now.)

The main challenge here is that the tree is like dataTable.  The
renderer iterrates over the data one node at a time.  The same happens
for the ActionEvents.  So as its decoding if it realizes a node was
clicked it can mark the *current* node as selected.

Perhaps we could modify tree2 to allow you to specify a nodeId and
also allow you to set the selected node that way.  Would that help?

sean

ps. These kinds of questions are better posted on the myfaces-user
list.  No big deal ...


On Thu, 24 Mar 2005 10:59:37 -0800 (PST), Eric Hsieh <ec...@yahoo.com> wrote:
> Along the same lines as my earlier question regarding
> current node selection (Thanks Matthias for forwarding
> Sean's answer!), is there any way to remotely set the
> currently selected node in the tree?
> 
> My scenario is the following: from a popup window I'm
> adding a new element to the db.  This element will
> appear in the tree in the main window whenever the
> tree refreshes.  I want the element that was just
> added to be selected once the tree refreshes.
> Possible?
> 
> FYI, I'm creating a tree of TreeNodeBase nodes.  Could
> I look up the object populating <x:tree2 value=""> and
> set a selected flag on one of the nodes?
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business - Try our new resources site!
> http://smallbusiness.yahoo.com/resources/
>