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 Prescott <mi...@gmail.com> on 2013/04/23 19:06:11 UTC

@BeginRender equivalent for component AJAX events

I have a component that includes a zone - the zone is periodically
refreshed using the ZoneRefresh mixin.

Is there any equivalent to @BeginRender that I can use to set up data to
support the zone re-rendering?  @BeginRender methods are called when the
page renders, but they're not called when the zone re-renders via ajax.

The only event I've found that gets called is @PageAttached, but of course
this is deprecated.

Any tips would be appreciated!

Gratefully,

Michael

Re: @BeginRender equivalent for component AJAX events

Posted by Ivan Khalopik <ik...@gmail.com>.
One note about ZoneRefresh mixin:

https://issues.apache.org/jira/browse/TAP5-2100

So it provides not the original event context(that was encoded in url) but
the context populated from parameter. And so it has no sence for now.



On Wed, Apr 24, 2013 at 4:21 PM, Michael Prescott <
michael.r.prescott@gmail.com> wrote:

> Okay! I've filed it as https://issues.apache.org/jira/browse/TAP5-2111
>
>
> On 24 April 2013 09:07, Lance Java <la...@googlemail.com> wrote:
>
> > Far from being a gory detail, it's part of the public API for the mixin,
> > very similar to AutoComplete's "provideCompletions" event.
> >
> > The mixin should ideally declare the event using @Events("refresh") and
> > should have a mention in the javadoc too.
> >
>



-- 
BR
Ivan

Re: @BeginRender equivalent for component AJAX events

Posted by Michael Prescott <mi...@gmail.com>.
Okay! I've filed it as https://issues.apache.org/jira/browse/TAP5-2111


On 24 April 2013 09:07, Lance Java <la...@googlemail.com> wrote:

> Far from being a gory detail, it's part of the public API for the mixin,
> very similar to AutoComplete's "provideCompletions" event.
>
> The mixin should ideally declare the event using @Events("refresh") and
> should have a mention in the javadoc too.
>

Re: @BeginRender equivalent for component AJAX events

Posted by Lance Java <la...@googlemail.com>.
Far from being a gory detail, it's part of the public API for the mixin,
very similar to AutoComplete's "provideCompletions" event.

The mixin should ideally declare the event using @Events("refresh") and
should have a mention in the javadoc too.

Re: @BeginRender equivalent for component AJAX events

Posted by Michael Prescott <mi...@gmail.com>.
Thanks, Lance, that looks like it will do the trick nicely.

Do you think that the 'refresh' event should be added to the ZoneRefresh
mixin's documentation?  Is this public/won't change, or a gory internal
detail?


On 24 April 2013 04:47, Lance Java <la...@googlemail.com> wrote:

> The ZoneRefresh mixin fires the "refresh" event passing the (optional)
> context parameter.
>
> So, add a handler to the containing page / component.
>
> Eg: void onRefresh(Foo context) {...}
>
> If you return a Block, this will be rendered (zone.getBody() renders by
> default).
>

Re: @BeginRender equivalent for component AJAX events

Posted by Lance Java <la...@googlemail.com>.
The ZoneRefresh mixin fires the "refresh" event passing the (optional)
context parameter.

So, add a handler to the containing page / component.

Eg: void onRefresh(Foo context) {...}

If you return a Block, this will be rendered (zone.getBody() renders by
default).