Tapestry
  1. Tapestry
  2. TAPESTRY-2286

Support JSONArray as a valid return type from AJAX event handlers

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0, 5.0.12
    • Fix Version/s: 5.0.15
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      I have an ajax handler that needs to return a list of json objects. It would be convenient if I could just return a JSONArray instance as I can a JSONObject, so I can easily return the list. According to the documentation (http://tapestry.apache.org/tapestry5/tapestry-core/guide/ajax.html) and the exception being thrown, this is not currently possible. For my case I have to wrap the response in a dummy object with a single member (the array of objects), to satisfy tapestry.

      1. jsonarray-response.patch
        1 kB
        Chris Lewis
      2. JSONArrayEventResultProcessor.java
        2 kB
        Chris Lewis

        Activity

        Chris Lewis created issue -
        Hide
        Chris Lewis added a comment -

        New event processor and patch for binding in the Tapestry module.

        Show
        Chris Lewis added a comment - New event processor and patch for binding in the Tapestry module.
        Chris Lewis made changes -
        Field Original Value New Value
        Attachment jsonarray-response.patch [ 12378248 ]
        Attachment JSONArrayEventResultProcessor.java [ 12378247 ]
        Hide
        Chris Lewis added a comment -

        These attachments are against r638901.

        Show
        Chris Lewis added a comment - These attachments are against r638901.
        Chris Lewis made changes -
        Fix Version/s 5.0.12 [ 12313048 ]
        Howard M. Lewis Ship made changes -
        Fix Version/s 5.0.13 [ 12313205 ]
        Fix Version/s 5.0.12 [ 12313048 ]
        Howard M. Lewis Ship made changes -
        Fix Version/s 5.0.13 [ 12313205 ]
        Fix Version/s 5.0 [ 12312018 ]
        Howard M. Lewis Ship made changes -
        Assignee Howard M. Lewis Ship [ hlship ]
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Howard M. Lewis Ship made changes -
        Fix Version/s 5.0 [ 12312018 ]
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        Fix Version/s 5.0.15 [ 12313350 ]
        Mark Thomas made changes -
        Workflow jira [ 12426915 ] Default workflow, editable Closed status [ 12568623 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12568623 ] jira [ 12591657 ]

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Chris Lewis
          • Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development