Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-2286

Support JSONArray as a valid return type from AJAX event handlers

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 5.0, 5.0.12
    • 5.0.15
    • tapestry-core
    • 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.

      Attachments

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

        Activity

          People

            hlship Howard Lewis Ship
            chrislewis Chris Lewis
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: