Never mind about this question; I figured out how to do it without
having to change the model; I just add the following inside each
<h:commandLink action="#{t.toggleExpanded}">...</h:commandLink> group:

<f:actionListener type="..."/>

The class I specify inside the "type" attribute then successfully
intercepts each expand/collapse event.

So I successfully got the Tree2 control to work using the IBM RAD/RSA
IDE, although it still depends upon the MyFaces JSF implementation; I
can't get it to work using Sun's RI.

- Brendan

P.S. I *would* be interested, however, if Sean could elaborate on some
of the HTML that's produced by the tree2 control, however.
Specifically, when doing a "view source" on what's produced, the HTML
appears to be referring to dynamically generated JavaScript.  (At least
the path that's specified for the JavaScript appears to have a generated
ID embedded in it.)  Any explanation of this would be much appreciated.

-----Original Message-----
From: Sean Schofield [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 28, 2005 5:58 PM
To: MyFaces Discussion
Subject: Re: Handling the "node expanded" action in Tree2 to Get More
Data


Sorry, haven't had a chance to look into this proposal in detail. 
Remind me sometime next week if I still haven't responded.  I am
anxious to improve tree2 but the reorg is taking all of my spare time
at the moment.

sean

On 6/28/05, Martin Marinschek <[EMAIL PROTECTED]> wrote:
> I think that sounds quite nice as functionality goes, I am no expert
> on the tree2, though.
> 
> Sean having any thoughts on that?
> 
> regards,
> 
> Martin
> 
> On 6/28/05, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]> wrote:
> > I'm assuming that, since no one has answered this, that there isn't
an
> > easy way to do it as written.  Therefore, I'm looking into extending
the
> > Tree2 component so its action takes another parameter:
> > toggleActionListener="#{myListener}"
> >
> > Behind the scenes, if this parameter is specified, the tree
component
> > would execute addAction() on the expandControl, thus allowing the
> > application developer the ability to intercept the expand or
collapse
> > events and do other things, such as read the database for more data
> > beneath that node.
> >
> > Does this sound like a reasonable approach, or is the equivalent
> > functionality already there, and I'm just missing it?
> >
> > - Brendan
> >
> > -------------------
> >
> > When a use clicks the "expand" icon in a serverside Tree2 component,
I
> > would like my application to go out and grab more data from the
database
> > to fill in the details of that node's children.  What's the hook in
> > Tree2 that I can use to do that?  Should I override one of the
methods?
> > Should I intercept some sort of action?
> >
> > At first, I tried subclassing TreeNodeBase and overriding the
> > getChildren method so it calls a routine in my application to get
more
> > data.  However, this results in having all the data in the entire
tree
> > retrieved after just clicking on the root, which is not what I want.
I
> > want just the data for the immediate children retrieved from the
> > database when a parent node's "expand" icon is clicked.
> >
> > Any usage help would be much appreciated!
> >
> > - Brendan
> >
> >
>

Reply via email to