You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Thiago H. de Paula Figueiredo" <th...@terra.com.br> on 2008/07/04 18:42:58 UTC

[T5] Handling an event from an embedded component

Say I have a List page. Inside it, I have an ActionLinks component. Inside  
ActionLinks, I have an ActionLink with t:id remove. How, in the List page,  
can I handle the action event from the remove ActionLink?

In other words, how can I handle events from a given component embedded in  
another component without simply catching all events of a given type?

Thanks in advance.

Thiago

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


Re: [T5] Handling an event from an embedded component

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Sun, 06 Jul 2008 20:01:55 -0300, Robert Zeigler <ro...@scazdl.org>  
escreveu:

> Hi Thiago,

Hi, Robert!

> Which you then document. Now your page catches:
> onRemoveFrom... where ... is the id of the component in the page.
> The ability to trigger new events based on existing ones is a really  
> powerful way to hide the implementation details of your component, and  
> provide a "public api" for events, etc.

Thank you very much! That's exactly what I needed!
As Matt Rabile once said, this message list's users are really more  
enlightened than most. :)

Thiago

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


Re: [T5] Handling an event from an embedded component

Posted by Robert Zeigler <ro...@scazdl.org>.
Hi Thiago,

My recommendation would be to catch the events from your component,  
and then trigger your own, custom events.
For your ActionLinks component, for example, you might have a handler  
in the component:
onActionFromRemove(Object toRemove) {
     resources.triggerEvent(...);
}

Then you trigger your own custom event "REMOVE".

Which you then document. Now your page catches:
onRemoveFrom... where ... is the id of the component in the page.
The ability to trigger new events based on existing ones is a really  
powerful way to hide the implementation details of your component, and  
provide a "public api" for events, etc.

HTH,

Robert

On Jul 5, 2008, at 7/53:03 PM , Thiago H. de Paula Figueiredo wrote:

> Em Fri, 04 Jul 2008 19:10:20 -0300, Stephane Decleire <sdecleire@cariboo-networks.com 
> > escreveu:
>
>> Isn't it the purpose of EventLink ?
>
> I think so, but I've just discovered that after I sent that message.  
> But what about form submissions, for example? I wanted to do a  
> component that had a form with some added bits, but how could I  
> handle the form events?
>
> Thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


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


Re: [T5] Handling an event from an embedded component

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Fri, 04 Jul 2008 19:10:20 -0300, Stephane Decleire  
<sd...@cariboo-networks.com> escreveu:

> Isn't it the purpose of EventLink ?

I think so, but I've just discovered that after I sent that message. But  
what about form submissions, for example? I wanted to do a component that  
had a form with some added bits, but how could I handle the form events?

Thiago

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


Re: [T5] Handling an event from an embedded component

Posted by Stephane Decleire <sd...@cariboo-networks.com>.
Isn't it the purpose of EventLink ?

Stephane

Thiago H. de Paula Figueiredo a écrit :
> Em Fri, 04 Jul 2008 13:42:58 -0300, Thiago H. de Paula Figueiredo 
> <th...@terra.com.br> escreveu:
>
>> Say I have a List page. Inside it, I have an ActionLinks component. 
>> Inside ActionLinks, I have an ActionLink with t:id remove. How, in 
>> the List page, can I handle the action event from the remove ActionLink?
>>
>> In other words, how can I handle events from a given component 
>> embedded in another component without simply catching all events of a 
>> given type?
>
> Rewording my question, how can I refer to an component id, being this 
> component inside another component?
>
> Thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

Re: [T5] Handling an event from an embedded component

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Fri, 04 Jul 2008 13:42:58 -0300, Thiago H. de Paula Figueiredo  
<th...@terra.com.br> escreveu:

> Say I have a List page. Inside it, I have an ActionLinks component.  
> Inside ActionLinks, I have an ActionLink with t:id remove. How, in the  
> List page, can I handle the action event from the remove ActionLink?
>
> In other words, how can I handle events from a given component embedded  
> in another component without simply catching all events of a given type?

Rewording my question, how can I refer to an component id, being this  
component inside another component?

Thiago

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