Getting the target zone ID for an eventLink

61 views
Skip to first unread message

Alex Kochnev

unread,
Sep 29, 2014, 12:18:04 AM9/29/14
to tapestry...@googlegroups.com
I've been trying to sort out how to add a loading indicator / spinner w/ Tapestry. Now, I found a few references (e.g. jumpstart - http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/loadingspinner , flowlogic : https://code.google.com/p/flowlogix/wiki/TapestryLibrary); however, all of them rely on prototype and the presence of the Tapestry.findZoneManager function to find the zone manager for an ajax link. The way that seems to work w/ prototype is that Tapestry is using "local storage" in each DOM node to store the zone ID, and then uses the same to get it back. 

I had a quick peek at the source for tapestry5-jquery, and I don't see anything similar - the zone ID for an element is always passed in explicitly. 

So, the question is - if I have an event fired from the ajax event link, is there a way for me to get the id of the zone that the result of the event will update ? 

Cheers - Alex K

Emmanuel DEMEY

unread,
Sep 29, 2014, 2:40:18 AM9/29/14
to tapestry...@googlegroups.com
Hi Alex 

I have just checked the source code. And I think there is not easy to get this information. Maybe with a regexp and the href attribute of the event link. 

For your loading behavior, you can maybe use the Tapestry.TRIGGER_ZONE_UPDATE_EVENT event triggered by your link, in order to display the loader.
el.bind(Tapestry.TRIGGER_ZONE_UPDATE_EVENT, function() {});

And, when your zone has been updated, you can hide it with the Tapestry.ZONE_UPDATED_EVENT triggered by the zone.

Manu
Reply all
Reply to author
Forward
0 new messages