Re: Handling an event from an embedded component

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Handling an event from an embedded component

Thiago H. de Paula Figueiredo
Em Fri, 04 Jul 2008 19:10:20 -0300, Stephane Decleire  
<[hidden email]> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Handling an event from an embedded component

Robert Zeigler
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 <[hidden email]
> > 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: [hidden email]
> For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Thiago H. de Paula Figueiredo
Em Sun, 06 Jul 2008 20:01:55 -0300, Robert Zeigler <[hidden email]>  
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: [hidden email]
For additional commands, e-mail: [hidden email]