You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Paul Stanton <pa...@mapshed.com.au> on 2010/08/06 03:08:16 UTC

adding a javascript call to be run after all multizone updates are performed

Hi all,

I've got an ajax event listener  which returns a MultiZoneUpdate.

I need to also run a script AFTER all of the zones have been updated.

What is the simplest way to achieve this?

Regards, Paul.

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


Re: adding a javascript call to be run after all multizone updates are performed

Posted by Paul Stanton <pa...@mapshed.com.au>.
Thanks Thiago, but I don't think that helps as I need to include the 
script from within my event listener ie Java server side.

I trawled through the list and found a post by Josh C that does the 
trick perfectly, i quote:

Try this:

    @Inject
    private RenderSupport _support;

    @Inject
    private PageRenderQueue _queue;

    MultiZoneUpdate onHello() {
        _queue.addPartialMarkupRendererFilter(new
PartialMarkupRendererFilter() {
            public void renderMarkup(MarkupWriter writer, JSONObject
reply, PartialMarkupRenderer renderer) {
                _support.addScript("alert('I am script');");
                renderer.renderMarkup(writer, reply);
            }
        });
        return new MultiZoneUpdate("test", _timeBlock);
    }


Thanks again Josh and Thiago,

regards, p.



Thiago H. de Paula Figueiredo wrote:
> On Thu, 05 Aug 2010 22:08:16 -0300, Paul Stanton <pa...@mapshed.com.au> 
> wrote:
>
>> Hi all,
>
> Hi!
>
>> I've got an ajax event listener  which returns a MultiZoneUpdate.
>> I need to also run a script AFTER all of the zones have been updated.
>> What is the simplest way to achieve this?
>
> Take a look at http://api.prototypejs.org/ajax/ajax/responders/.
>

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


Re: adding a javascript call to be run after all multizone updates are performed

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 05 Aug 2010 22:08:16 -0300, Paul Stanton <pa...@mapshed.com.au>  
wrote:

> Hi all,

Hi!

> I've got an ajax event listener  which returns a MultiZoneUpdate.
> I need to also run a script AFTER all of the zones have been updated.
> What is the simplest way to achieve this?

Take a look at http://api.prototypejs.org/ajax/ajax/responders/.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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