I can see why someone would want to "search" for a node with a
particular value.  That could be the case if the user is staring at a
large tree and doesn't know where a particular node is in the tree, but
the user knows the "value" of the node (e.g., a part number or someone's
name).  Is that the question?

If so, I don't think any JS is required.  It would just mean that the
managed bean taking care of the search would have to be able to traverse
the tree and select the node matching the search criterion.  (I'm not
sure how *that* would work, though; I haven't looked at the latest
architecture for the tree.)

- Brendan

-----Original Message-----
From: Sean Schofield [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 10, 2005 3:54 PM
To: MyFaces Discussion
Subject: Re: Tree2 dynamically selecting and expanding nodes


Why on earth would you want to do this?  Sounds like a bizarre
interface to me.  The whole point of a tree is you can navigate easily
with a *mouse.*  I'm sure its possible but you may need to rewrite
signficant portions of tree2 b/c the javascript would be so
specialized.

sean

On 8/10/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>  
> Good luck.  You may want to start by writing an onChange event handler
for
> the textbox.  The event handler could check the value of the textbox,
then
> walk the client side DOM looking for a tree node with a matching name.

> That's a lot of walking though.  Everything has an id of course, so
you
> could easily simulate a expand/click event for that particular node. 
>  
> Dennis Byrne
>  
>  
>  
>  
>  Jeff Cooper <[EMAIL PROTECTED]> 
> 
> 08/10/2005 12:33 PM 
>  
> Please respond to
>  "MyFaces Discussion" <[email protected]> 
>  
>  
> To [email protected] 
>  
> cc 
>  
> Subject Tree2 dynamically selecting and expanding nodes 
>  
>  
>  
>  
>  
> The page I'm developing has a textbox that will allow users to type,
which
> is supposed to highlight the node they've typed in the tree2 control.
Has
> anyone did something similar to this; or dynamically selected and
expanded
> nodes.  Sorry if this has been posted before, but I couldn't find
anything
> in the mailing list.  I'm using myfaces1.0.9.
>  
>  Thanks,
>  Jeff Cooper 
>

Reply via email to