You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Stephane Decleire <sd...@cariboo-networks.com> on 2008/04/10 11:30:43 UTC

T5 : Event bubbling

Hi,

I have several components encompassed in each other : say A encompasses 
B which encompasses C.
When someone trigger an eventlink in C, i try to catch the event in B in 
a handler like this one :

    @OnEvent (value="action")
    Object change() {
        // ... management of the action ...
        return null;
    }

I need to return null to show the same page to the user but returning 
null seems to imply that my handler does not catch the event and it 
bubbles to the following handler in A :

    @OnEvent (value="action")
    Object manage() {
        // ... management of the action ...
    }

Is it the correct behavior of event bubbling in T5 (i mean handlers 
which returns null values do not catch the event) ?
If yes, what is the solution for an handler to both catch the event and 
show the same page to the user ?

Thanks in advance

Stephane

Re: T5 : Event bubbling

Posted by Stephane Decleire <sd...@cariboo-networks.com>.
Thanks Armand.
Returning 'this' works great !

Stephane

Francois Armand a écrit :
> Stephane Decleire wrote:
>>  correct behavior of event bubbling in T5 (i mean handlers which 
>> returns null values do not catch the event) ?
>> If yes, what is the solution for an handler to both catch the event 
>> and show the same page to the user ?
>>
> Returning a non null value is the think to do, see : 
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/event.html
>
> If you want to return the same page, just return the page object 
> (available thanks to ComponentResources#getPage() ).
> Perhaps if you return this, T5 will do the job for you.
>

Re: T5 : Event bubbling

Posted by Francois Armand <fa...@linagora.com>.
Stephane Decleire wrote:
>  correct behavior of event bubbling in T5 (i mean handlers which 
> returns null values do not catch the event) ?
> If yes, what is the solution for an handler to both catch the event 
> and show the same page to the user ?
>
Returning a non null value is the think to do, see : 
http://tapestry.apache.org/tapestry5/tapestry-core/guide/event.html

If you want to return the same page, just return the page object 
(available thanks to ComponentResources#getPage() ).
Perhaps if you return this, T5 will do the job for you.

-- 
Francois Armand
Etudes & Développements J2EE
Groupe Linagora - http://www.linagora.com
Tél.: +33 (0)1 58 18 68 28
-----------
InterLDAP - http://interldap.org 
FederID - http://www.federid.org/
Open Source identities management and federation


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