Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1404

Should be possible to perform an Ajax request without linking the component (link or form) to a Zone


    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.3, 5.2
    • Fix Version/s: 5.4
    • Component/s: None
    • Labels:


      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.


          Issue Links



              • Assignee:
                hlship Howard M. Lewis Ship
                paul.stanton Paul Stanton
              • Votes:
                8 Vote for this issue
                7 Start watching this issue


                • Created: