You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Paul Stanton (JIRA)" <ji...@apache.org> on 2011/01/07 08:01:45 UTC

[jira] Created: (TAP5-1404) add 'xhr' parameter to components which perform navigation - make zone parameter optional

add 'xhr' parameter to components which perform navigation - make zone parameter optional
-----------------------------------------------------------------------------------------

                 Key: TAP5-1404
                 URL: https://issues.apache.org/jira/browse/TAP5-1404
             Project: Tapestry 5
          Issue Type: Improvement
    Affects Versions: 5.2.4
            Reporter: Paul Stanton


To specify that you want to perform an XHR request (EventLink, ActionLink, Form etc), you need to supply the zone parameter. The existence of this parameter is a flag that tells the component to use XHR. In some cases this may be useful (although I'm yet to find one). This strikes me as bad design since there is not necessarily a known One-to-One relationship between the event and the zone(s) updated.

If you return a Zone or MultiZoneUpdate from your event handler, the actual zone you supply the requesting component is irrelevant.

Since all of my XHR event handlers return a MultiZoneUpdate, I ended up creating a dummy zone on every page and component and supplying that to every zone parameter. The dummy zone was always hidden and never actually updated. This hack made it easier to code and maintain my pages because without it i would need to search for an arbitrary zone on each page when creating callbacks.

The solution would be to add a 'xhr' parameter to the components (EventLink, Form etc) and for the zone parameter to be an optional if xhr is true.

You could even hard set xhr=true if zone!=null for backwards compatibility.

This would require Tapestry to lose the dependency on zones to create contextual XHR requests which I think is the limiting design decision plaguing this area of tapestry.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] [Updated] (TAP5-1404) add 'xhr' parameter to components which perform navigation - make zone parameter optional

Posted by "Paul Stanton (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1404?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Stanton updated TAP5-1404:
-------------------------------

    Affects Version/s: 5.3

This persists in 5.3

This 'should' work without any zones on the page whatsoever. A zone update is not required for AjaxResponseRenderer to be valid, therefore relying on a zone being present is illogical.

While a rare case, what would be wrong with executing an eventlink (or the like) who's event handler just adds a script command to the AjaxResponseRenderer?

tml:

<a t:type="eventlink" event="click" xhr="true">click</a>

java:

private void onClick()
{
    ajaxResponseRenderer.addCallback(new JavaScriptCallback() {
            @Override
            public void run(JavaScriptSupport javascriptSupport) {
                javascriptSupport.addScript("alert('hello');");
            }
        });
}


The problem is that the whole reliance on ZoneManager (tapestry.js) for ajax response processing is out dated. I'm guessing that it's left over from some old architecture where an event was tied to a single zone for request/response handling, and then MultiZoneUpdate support was shoe-horned in without re-thinking the design. AjaxResponseRenderer is a clear improvement in the java area, however the tml/js area has been left behind.

p.
                
> add 'xhr' parameter to components which perform navigation - make zone parameter optional
> -----------------------------------------------------------------------------------------
>
>                 Key: TAP5-1404
>                 URL: https://issues.apache.org/jira/browse/TAP5-1404
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.3, 5.2
>            Reporter: Paul Stanton
>
> To specify that you want to perform an XHR request (EventLink, ActionLink, Form etc), you need to supply the zone parameter. The existence of this parameter is a flag that tells the component to use XHR. In some cases this may be useful (although I'm yet to find one). This strikes me as bad design since there is not necessarily a known One-to-One relationship between the event and the zone(s) updated.
> If you return a Zone or MultiZoneUpdate from your event handler, the actual zone you supply the requesting component is irrelevant.
> Since all of my XHR event handlers return a MultiZoneUpdate, I ended up creating a dummy zone on every page and component and supplying that to every zone parameter. The dummy zone was always hidden and never actually updated. This hack made it easier to code and maintain my pages because without it i would need to search for an arbitrary zone on each page when creating callbacks.
> The solution would be to add a 'xhr' parameter to the components (EventLink, Form etc) and for the zone parameter to be an optional if xhr is true.
> You could even hard set xhr=true if zone!=null for backwards compatibility.
> This would require Tapestry to lose the dependency on zones to create contextual XHR requests which I think is the limiting design decision plaguing this area of tapestry.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (TAP5-1404) add 'xhr' parameter to components which perform navigation - make zone parameter optional

Posted by "Paul Stanton (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1404?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Stanton updated TAP5-1404:
-------------------------------

    Affects Version/s: 5.3

This persists in 5.3

This 'should' work without any zones on the page whatsoever. A zone update is not required for AjaxResponseRenderer to be valid, therefore relying on a zone being present is illogical.

While a rare case, what would be wrong with executing an eventlink (or the like) who's event handler just adds a script command to the AjaxResponseRenderer?

tml:

<a t:type="eventlink" event="click" xhr="true">click</a>

java:

private void onClick()
{
    ajaxResponseRenderer.addCallback(new JavaScriptCallback() {
            @Override
            public void run(JavaScriptSupport javascriptSupport) {
                javascriptSupport.addScript("alert('hello');");
            }
        });
}


The problem is that the whole reliance on ZoneManager (tapestry.js) for ajax response processing is out dated. I'm guessing that it's left over from some old architecture where an event was tied to a single zone for request/response handling, and then MultiZoneUpdate support was shoe-horned in without re-thinking the design. AjaxResponseRenderer is a clear improvement in the java area, however the tml/js area has been left behind.

p.
                
> add 'xhr' parameter to components which perform navigation - make zone parameter optional
> -----------------------------------------------------------------------------------------
>
>                 Key: TAP5-1404
>                 URL: https://issues.apache.org/jira/browse/TAP5-1404
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.3, 5.2
>            Reporter: Paul Stanton
>
> To specify that you want to perform an XHR request (EventLink, ActionLink, Form etc), you need to supply the zone parameter. The existence of this parameter is a flag that tells the component to use XHR. In some cases this may be useful (although I'm yet to find one). This strikes me as bad design since there is not necessarily a known One-to-One relationship between the event and the zone(s) updated.
> If you return a Zone or MultiZoneUpdate from your event handler, the actual zone you supply the requesting component is irrelevant.
> Since all of my XHR event handlers return a MultiZoneUpdate, I ended up creating a dummy zone on every page and component and supplying that to every zone parameter. The dummy zone was always hidden and never actually updated. This hack made it easier to code and maintain my pages because without it i would need to search for an arbitrary zone on each page when creating callbacks.
> The solution would be to add a 'xhr' parameter to the components (EventLink, Form etc) and for the zone parameter to be an optional if xhr is true.
> You could even hard set xhr=true if zone!=null for backwards compatibility.
> This would require Tapestry to lose the dependency on zones to create contextual XHR requests which I think is the limiting design decision plaguing this area of tapestry.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1404) add 'xhr' parameter to components which perform navigation - make zone parameter optional

Posted by "Lance (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13181196#comment-13181196 ] 

Lance commented on TAP5-1404:
-----------------------------

This recent conversation on the mailing list http://tapestry.1045711.n5.nabble.com/Eventlink-Ajax-without-zone-parameter-td5122653.html confirms that there are quite a few people who want a resolution to this problem.
                
> add 'xhr' parameter to components which perform navigation - make zone parameter optional
> -----------------------------------------------------------------------------------------
>
>                 Key: TAP5-1404
>                 URL: https://issues.apache.org/jira/browse/TAP5-1404
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.2
>            Reporter: Paul Stanton
>
> To specify that you want to perform an XHR request (EventLink, ActionLink, Form etc), you need to supply the zone parameter. The existence of this parameter is a flag that tells the component to use XHR. In some cases this may be useful (although I'm yet to find one). This strikes me as bad design since there is not necessarily a known One-to-One relationship between the event and the zone(s) updated.
> If you return a Zone or MultiZoneUpdate from your event handler, the actual zone you supply the requesting component is irrelevant.
> Since all of my XHR event handlers return a MultiZoneUpdate, I ended up creating a dummy zone on every page and component and supplying that to every zone parameter. The dummy zone was always hidden and never actually updated. This hack made it easier to code and maintain my pages because without it i would need to search for an arbitrary zone on each page when creating callbacks.
> The solution would be to add a 'xhr' parameter to the components (EventLink, Form etc) and for the zone parameter to be an optional if xhr is true.
> You could even hard set xhr=true if zone!=null for backwards compatibility.
> This would require Tapestry to lose the dependency on zones to create contextual XHR requests which I think is the limiting design decision plaguing this area of tapestry.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1404) add 'xhr' parameter to components which perform navigation - make zone parameter optional

Posted by "Paul Stanton (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13184851#comment-13184851 ] 

Paul Stanton commented on TAP5-1404:
------------------------------------

'async' is probably preferred.

anyone remember tapestry 4?
                
> add 'xhr' parameter to components which perform navigation - make zone parameter optional
> -----------------------------------------------------------------------------------------
>
>                 Key: TAP5-1404
>                 URL: https://issues.apache.org/jira/browse/TAP5-1404
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.3, 5.2
>            Reporter: Paul Stanton
>
> To specify that you want to perform an XHR request (EventLink, ActionLink, Form etc), you need to supply the zone parameter. The existence of this parameter is a flag that tells the component to use XHR. In some cases this may be useful (although I'm yet to find one). This strikes me as bad design since there is not necessarily a known One-to-One relationship between the event and the zone(s) updated.
> If you return a Zone or MultiZoneUpdate from your event handler, the actual zone you supply the requesting component is irrelevant.
> Since all of my XHR event handlers return a MultiZoneUpdate, I ended up creating a dummy zone on every page and component and supplying that to every zone parameter. The dummy zone was always hidden and never actually updated. This hack made it easier to code and maintain my pages because without it i would need to search for an arbitrary zone on each page when creating callbacks.
> The solution would be to add a 'xhr' parameter to the components (EventLink, Form etc) and for the zone parameter to be an optional if xhr is true.
> You could even hard set xhr=true if zone!=null for backwards compatibility.
> This would require Tapestry to lose the dependency on zones to create contextual XHR requests which I think is the limiting design decision plaguing this area of tapestry.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1404) add 'xhr' parameter to components which perform navigation - make zone parameter optional

Posted by "Lance (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13184846#comment-13184846 ] 

Lance commented on TAP5-1404:
-----------------------------

I have a minor issue using the term "xhr" vs "ajax" as ajax > xhr

It is possible to perform ajax without using an XmlHttpRequest. For instance, in some browsers it is not currently possible to ajax upload a file. Instead, you must post a form to a hidden iframe. I haven't looked at the code but it is possible that tapestry uses this method when posting a form to a zone. 
                
> add 'xhr' parameter to components which perform navigation - make zone parameter optional
> -----------------------------------------------------------------------------------------
>
>                 Key: TAP5-1404
>                 URL: https://issues.apache.org/jira/browse/TAP5-1404
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.3, 5.2
>            Reporter: Paul Stanton
>
> To specify that you want to perform an XHR request (EventLink, ActionLink, Form etc), you need to supply the zone parameter. The existence of this parameter is a flag that tells the component to use XHR. In some cases this may be useful (although I'm yet to find one). This strikes me as bad design since there is not necessarily a known One-to-One relationship between the event and the zone(s) updated.
> If you return a Zone or MultiZoneUpdate from your event handler, the actual zone you supply the requesting component is irrelevant.
> Since all of my XHR event handlers return a MultiZoneUpdate, I ended up creating a dummy zone on every page and component and supplying that to every zone parameter. The dummy zone was always hidden and never actually updated. This hack made it easier to code and maintain my pages because without it i would need to search for an arbitrary zone on each page when creating callbacks.
> The solution would be to add a 'xhr' parameter to the components (EventLink, Form etc) and for the zone parameter to be an optional if xhr is true.
> You could even hard set xhr=true if zone!=null for backwards compatibility.
> This would require Tapestry to lose the dependency on zones to create contextual XHR requests which I think is the limiting design decision plaguing this area of tapestry.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1404) add 'xhr' parameter to components which perform navigation - make zone parameter optional

Posted by "Lance (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13181196#comment-13181196 ] 

Lance commented on TAP5-1404:
-----------------------------

This recent conversation on the mailing list http://tapestry.1045711.n5.nabble.com/Eventlink-Ajax-without-zone-parameter-td5122653.html confirms that there are quite a few people who want a resolution to this problem.
                
> add 'xhr' parameter to components which perform navigation - make zone parameter optional
> -----------------------------------------------------------------------------------------
>
>                 Key: TAP5-1404
>                 URL: https://issues.apache.org/jira/browse/TAP5-1404
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.2
>            Reporter: Paul Stanton
>
> To specify that you want to perform an XHR request (EventLink, ActionLink, Form etc), you need to supply the zone parameter. The existence of this parameter is a flag that tells the component to use XHR. In some cases this may be useful (although I'm yet to find one). This strikes me as bad design since there is not necessarily a known One-to-One relationship between the event and the zone(s) updated.
> If you return a Zone or MultiZoneUpdate from your event handler, the actual zone you supply the requesting component is irrelevant.
> Since all of my XHR event handlers return a MultiZoneUpdate, I ended up creating a dummy zone on every page and component and supplying that to every zone parameter. The dummy zone was always hidden and never actually updated. This hack made it easier to code and maintain my pages because without it i would need to search for an arbitrary zone on each page when creating callbacks.
> The solution would be to add a 'xhr' parameter to the components (EventLink, Form etc) and for the zone parameter to be an optional if xhr is true.
> You could even hard set xhr=true if zone!=null for backwards compatibility.
> This would require Tapestry to lose the dependency on zones to create contextual XHR requests which I think is the limiting design decision plaguing this area of tapestry.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1404) add 'xhr' parameter to components which perform navigation - make zone parameter optional

Posted by "Lance (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13184846#comment-13184846 ] 

Lance commented on TAP5-1404:
-----------------------------

I have a minor issue using the term "xhr" vs "ajax" as ajax > xhr

It is possible to perform ajax without using an XmlHttpRequest. For instance, in some browsers it is not currently possible to ajax upload a file. Instead, you must post a form to a hidden iframe. I haven't looked at the code but it is possible that tapestry uses this method when posting a form to a zone. 
                
> add 'xhr' parameter to components which perform navigation - make zone parameter optional
> -----------------------------------------------------------------------------------------
>
>                 Key: TAP5-1404
>                 URL: https://issues.apache.org/jira/browse/TAP5-1404
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.3, 5.2
>            Reporter: Paul Stanton
>
> To specify that you want to perform an XHR request (EventLink, ActionLink, Form etc), you need to supply the zone parameter. The existence of this parameter is a flag that tells the component to use XHR. In some cases this may be useful (although I'm yet to find one). This strikes me as bad design since there is not necessarily a known One-to-One relationship between the event and the zone(s) updated.
> If you return a Zone or MultiZoneUpdate from your event handler, the actual zone you supply the requesting component is irrelevant.
> Since all of my XHR event handlers return a MultiZoneUpdate, I ended up creating a dummy zone on every page and component and supplying that to every zone parameter. The dummy zone was always hidden and never actually updated. This hack made it easier to code and maintain my pages because without it i would need to search for an arbitrary zone on each page when creating callbacks.
> The solution would be to add a 'xhr' parameter to the components (EventLink, Form etc) and for the zone parameter to be an optional if xhr is true.
> You could even hard set xhr=true if zone!=null for backwards compatibility.
> This would require Tapestry to lose the dependency on zones to create contextual XHR requests which I think is the limiting design decision plaguing this area of tapestry.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1404) add 'xhr' parameter to components which perform navigation - make zone parameter optional

Posted by "Paul Stanton (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13184851#comment-13184851 ] 

Paul Stanton commented on TAP5-1404:
------------------------------------

'async' is probably preferred.

anyone remember tapestry 4?
                
> add 'xhr' parameter to components which perform navigation - make zone parameter optional
> -----------------------------------------------------------------------------------------
>
>                 Key: TAP5-1404
>                 URL: https://issues.apache.org/jira/browse/TAP5-1404
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.3, 5.2
>            Reporter: Paul Stanton
>
> To specify that you want to perform an XHR request (EventLink, ActionLink, Form etc), you need to supply the zone parameter. The existence of this parameter is a flag that tells the component to use XHR. In some cases this may be useful (although I'm yet to find one). This strikes me as bad design since there is not necessarily a known One-to-One relationship between the event and the zone(s) updated.
> If you return a Zone or MultiZoneUpdate from your event handler, the actual zone you supply the requesting component is irrelevant.
> Since all of my XHR event handlers return a MultiZoneUpdate, I ended up creating a dummy zone on every page and component and supplying that to every zone parameter. The dummy zone was always hidden and never actually updated. This hack made it easier to code and maintain my pages because without it i would need to search for an arbitrary zone on each page when creating callbacks.
> The solution would be to add a 'xhr' parameter to the components (EventLink, Form etc) and for the zone parameter to be an optional if xhr is true.
> You could even hard set xhr=true if zone!=null for backwards compatibility.
> This would require Tapestry to lose the dependency on zones to create contextual XHR requests which I think is the limiting design decision plaguing this area of tapestry.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira