You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Marcel Ruff <mr...@marcelruff.info> on 2005/10/05 19:15:57 UTC

tree2: How to get the expand event to load more data?

Hi,

when a user  clicks on the '+' image of the tree to expand
it, i would like to intercept this click to load more data
into my tree model.

How can i register for such an event?

Some code snippets showing the work flow would be very helpful,

thanks
Marcel

PS: I have found some older threads about this topic but
i couldn't find out how to do it.

Re: tree2: How to get the expand event to load more data?

Posted by Marcel Ruff <mr...@marcelruff.info>.
Hi Sean,

thanks for your response.
I found
   src/tomahawk/org/apache/myfaces/custom/tree2/resource/javascript/tree.js
and i believe you talk about
   function treeNavClick(....)

The point is that i think it should be possible to register a Java (not 
javascript) listener method
to receive the clicks, it is in Java where i need to add sub-nodes.

I don't know where the proper location is for such a listener registration
to follow the JSF philosophy.
tree2 probably needs some refactoring to support this.

regards
Marcel


Sean Schofield wrote:

>There is a way to specify a javascript *location* instead of using the
>file in the component.   Specify your own javascript location and then
>copy the javascript file from the tree2 source to that location.  Then
>simply add your own stuff to the onclick.
>
>sean
>
>On 10/5/05, Marcel Ruff <mr...@marcelruff.info> wrote:
>  
>
>>Hi,
>>
>>when a user  clicks on the '+' image of the tree to expand
>>it, i would like to intercept this click to load more data
>>into my tree model.
>>
>>How can i register for such an event?
>>
>>Some code snippets showing the work flow would be very helpful,
>>
>>thanks
>>Marcel
>>
>>PS: I have found some older threads about this topic but
>>i couldn't find out how to do it.
>>
>>    
>>
>
>  
>


Re: tree2: How to get the expand event to load more data?

Posted by Sean Schofield <se...@gmail.com>.
There is a way to specify a javascript *location* instead of using the
file in the component.   Specify your own javascript location and then
copy the javascript file from the tree2 source to that location.  Then
simply add your own stuff to the onclick.

sean

On 10/5/05, Marcel Ruff <mr...@marcelruff.info> wrote:
> Hi,
>
> when a user  clicks on the '+' image of the tree to expand
> it, i would like to intercept this click to load more data
> into my tree model.
>
> How can i register for such an event?
>
> Some code snippets showing the work flow would be very helpful,
>
> thanks
> Marcel
>
> PS: I have found some older threads about this topic but
> i couldn't find out how to do it.
>