Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
5.1.0.1
-
None
-
None
Description
People keep asking for an easy way to activate zones from their own javascript.
I have created such a function for our project, but this easy/small convenience method should be in Tapestry core proper..
Tapestry.activateZone( zoneId, url )
and now with the multi-zone support, I wonder if zoneId if even required. It could be null, or another method could be created too:
Tapestry.activateZones( url )
Below is the js that I added to my project:
Tapestry.activateZone = function ( zoneId, url ) {
var zoneManager = Tapestry.findZoneManagerByZoneId( zoneId );
if ( zoneManager != null )
};
Tapestry.findZoneManagerByZoneId = function( zoneId ) {
var zoneElement = $(zoneId);
if (!zoneElement) {
Tapestry.ajaxError("Unable to locate Ajax Zone '#
return null;
}
var manager = $T(zoneElement).zoneManager;
if (!manager) {
Tapestry.ajaxError("Ajax Zone '#{id}
' does not have an associated Tapestry.ZoneManager object.",
{ id :zoneId });
return null;
}
return manager;
};