You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Support WebAlertPro <su...@webalertpro.com> on 2011/04/05 15:30:50 UTC

The right way to manually update a zone in tapestry

Hi,

I am calling a Tapestry action link manually from js, it's an ajax call
that returns a zone. I then swap out the old zone for the new zone html.

This all works well, except for that fact that any Tapestry js callbacks
that would normally be triggered when the zone loads on the page (i.e.
if this was all done Tap via an action link zone update) are not called,
resulting in actionlinks within the zone that do not work as expected.

Is there a correct way to swap out a zone on a page manually using js,
possibly calling one of the Tapestry.js functions?

Joel


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


Re: The right way to manually update a zone in tapestry

Posted by Joel Halbert <jo...@su3analytics.com>.
OK figured it out...

Trick is to use the ZoneManager for the zone id (see Tapestry.js) :

So this ajax request, to update a zone, works, and all the tap js
callbacks on components are registered correctly


	var zoneManager =  Tapestry.findZoneManagerForZone('my-zone-id');
	$.get("/home.alerts:blockPath", {url:ignore_url, fullurl:fullurl,
ccid:ccid, area:ignore_isarea, title:title,block:block},
   	 function(responseJSON) {
           zoneManager.processReply(responseJSON);
         });


On Tue, 2011-04-05 at 14:30 +0100, Support WebAlertPro wrote:

> Hi,
> 
> I am calling a Tapestry action link manually from js, it's an ajax call
> that returns a zone. I then swap out the old zone for the new zone html.
> 
> This all works well, except for that fact that any Tapestry js callbacks
> that would normally be triggered when the zone loads on the page (i.e.
> if this was all done Tap via an action link zone update) are not called,
> resulting in actionlinks within the zone that do not work as expected.
> 
> Is there a correct way to swap out a zone on a page manually using js,
> possibly calling one of the Tapestry.js functions?
> 
> Joel