You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Massimo Lusetti (JIRA)" <ji...@apache.org> on 2011/08/12 17:40:27 UTC

[jira] [Commented] (TAP5-569) add convenience js method: Tapestry.activateZone( zoneId, url ), maybe Tapesry.activateZones( url )

    [ https://issues.apache.org/jira/browse/TAP5-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13084197#comment-13084197 ] 

Massimo Lusetti commented on TAP5-569:
--------------------------------------

Does this still desirable?

Maybe when the new latest features and work dedicated to js in tapestry is settled this could gain attention...

> add convenience js method: Tapestry.activateZone( zoneId, url ), maybe Tapesry.activateZones( url )
> ---------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-569
>                 URL: https://issues.apache.org/jira/browse/TAP5-569
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.1.0.1
>            Reporter: Fernando Padilla
>
> 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 ) {
>                 zoneManager.updateFromURL( url );
>         }
> };
> Tapestry.findZoneManagerByZoneId = function( zoneId ) {
>         var zoneElement = $(zoneId);
>         if (!zoneElement) {
>                 Tapestry.ajaxError("Unable to locate Ajax Zone '#{id}' for dynamic update.", { id:zoneId});
>                 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;
> };

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira