You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michael Gloegl <mi...@alemo.de> on 2007/01/23 17:40:34 UTC

Programmatically building EventListener

Hi all,

I would like to use the (very cool) EventListener AJAX-stuff in Tapestry 
4.1. in our project - however I am facing a little obstacle. Basically, 
the ids of the Elements to listen to are not known when writing the 
Page, due to various complex requirements.

So, simple question: Is it possible to programmatically attach 
EventListeners, for example in renderComponent()? The ids are known on 
component load-time, as they only depend on static component properties 
and the template. (no real application logic required).

Any pointers on where/how something like this could be included?

Thanks in advance,
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Programmatically building EventListener

Posted by Jesse Kuhnert <jk...@gmail.com>.
Are the ids not known because they are generated ? EventListener
should work with components that are rendered multiple times.. ie:

@EventListener(targets = "myComponent" , events = "onSomething")

works with:

<span jwcid="@For" source="myModel">
    <span jwcid="myComponent" />
</span>

On 1/23/07, Michael Gloegl <mi...@alemo.de> wrote:
> Hi all,
>
> I would like to use the (very cool) EventListener AJAX-stuff in Tapestry
> 4.1. in our project - however I am facing a little obstacle. Basically,
> the ids of the Elements to listen to are not known when writing the
> Page, due to various complex requirements.
>
> So, simple question: Is it possible to programmatically attach
> EventListeners, for example in renderComponent()? The ids are known on
> component load-time, as they only depend on static component properties
> and the template. (no real application logic required).
>
> Any pointers on where/how something like this could be included?
>
> Thanks in advance,
> Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org