You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Muhammad Gelbana <m....@gmail.com> on 2014/08/08 19:56:19 UTC

[t5.4-beta-6] Zone event handler isn't called

As far as I understand, *Zone* is a component and I can handle it's events.

So I types the following code:

@InjectComponent
> private Zone zoneSample;
> @OnEvent(component = "zoneSample")
> private void zoneEvent() {
> System.out.println(String.format("Zone client id: %s", zoneSample
> .getClientId()));
> }


No exception is thrown so the Zone ID is set correctly. But the event isn't
fired !
Shouldn't this event handling method match all events for the zone ?

I expected it to be fired basically before, while and after rendering the
zone because I need to see if I can obtain the generated zone's client-id
to use it to show this zone later on using the *AjaxResponseRenderer* class.

*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana

Re: [t5.4-beta-6] Zone event handler isn't called

Posted by Muhammad Gelbana <m....@gmail.com>.
I was planning on finding the phases where I can successfully run
zone.getClientId() to acquire it's client id. Then in the ajax handler
method, I can use the AjaxResponseRenderer to render the zone using it's
correct ID (Since I couldn't predict it because I couldn't assign it my
self and it always had a suffix added by Tapestry)

*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana


On Tue, Aug 12, 2014 at 3:23 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Tue, 12 Aug 2014 06:34:29 -0300, Muhammad Gelbana <m....@gmail.com>
> wrote:
>
>  I mixed between component events and rendering phases. I always thought
>> that component render phases are fired events by default but I was wrong.
>>
>> This answer cleared up a lot:
>> http://stackoverflow.com/questions/25213133/5-4-beta-6-
>> zone-event-handler-isnt-called
>>
>
> I'd add that there's a difference between component render events
> (afterRender, etc) and other events (I'd call that action events).
> Component render events are not bubbled, while action one does, and this
> explains why your code didn't work.
>
> RenderNotification is a mixin listens for the beginRender and afterRender
> component render events and triggers an action event.
>
> Everything here is completely unrelated to ids, t:id or HTML.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: [t5.4-beta-6] Zone event handler isn't called

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 12 Aug 2014 06:34:29 -0300, Muhammad Gelbana <m....@gmail.com>  
wrote:

> I mixed between component events and rendering phases. I always thought
> that component render phases are fired events by default but I was wrong.
>
> This answer cleared up a lot:
> http://stackoverflow.com/questions/25213133/5-4-beta-6-zone-event-handler-isnt-called

I'd add that there's a difference between component render events  
(afterRender, etc) and other events (I'd call that action events).  
Component render events are not bubbled, while action one does, and this  
explains why your code didn't work.

RenderNotification is a mixin listens for the beginRender and afterRender  
component render events and triggers an action event.

Everything here is completely unrelated to ids, t:id or HTML.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: [t5.4-beta-6] Zone event handler isn't called

Posted by Muhammad Gelbana <m....@gmail.com>.
I mixed between component events and rendering phases. I always thought
that component render phases are fired events by default but I was wrong.

This answer cleared up a lot:
http://stackoverflow.com/questions/25213133/5-4-beta-6-zone-event-handler-isnt-called

*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana


On Fri, Aug 8, 2014 at 8:56 PM, Muhammad Gelbana <m....@gmail.com>
wrote:

> As far as I understand, *Zone* is a component and I can handle it's
> events.
>
> So I types the following code:
>
> @InjectComponent
>> private Zone zoneSample;
>> @OnEvent(component = "zoneSample")
>> private void zoneEvent() {
>>  System.out.println(String.format("Zone client id: %s", zoneSample
>> .getClientId()));
>> }
>
>
> No exception is thrown so the Zone ID is set correctly. But the event
> isn't fired !
> Shouldn't this event handling method match all events for the zone ?
>
> I expected it to be fired basically before, while and after rendering the
> zone because I need to see if I can obtain the generated zone's client-id
> to use it to show this zone later on using the *AjaxResponseRenderer*
> class.
>
> *---------------------*
> *Muhammad Gelbana*
> http://www.linkedin.com/in/mgelbana
>