1. jsf-extensions

Need to return JSON in reponse instead of HTML


    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:


      Instead of replacing newly rendered HTML, I need to return JSON in the response
      to update HTML elements manually. (For example, I have a table which uses a
      scroll bar. Instead of replacing the entire table, I need to append additional
      rows to the existing DOM object.) I see that the suppressXML option can be used
      with FacesEvent, allowing any language to be used; however, I still need a way
      to get a hold of the JSON data returned in the response. I also prefer that this
      implementation handle the encoded client state string.

      Would it be possible to provide a JavaScript callback function here? For
      example, if a call back function is provided, the implementation would not
      attempt to replace HTML. Instead, the callback function would be invoked with
      the data contained in the XML schema. I'm envisioning that this callback
      function may take a couple parameters to identify the ajaxZone we're working
      with and the data returned in the request. For example:

      webui.textField.validate = function(ajaxZone, data) {}

      The XML returned in the response might incude a new "data" tag as shown below.
      Although, the "markup" tag could also be reused.

      <render id="form:table"/>
      JSON string from component
      <message>The messages element is optional. If present,
      it is a list of FacesMessage.getSummary() output
      <!-- repeat for the appropriate number of components -->
      <state><![CDATA[state information for this view ]]></state>

      An alternative approach may be to provide a JavaScript API, similar to how
      developers would retrieve component messages from the XML above. Perhaps we
      might consider using the Dojo event system to subscribe/publish an event,
      indicating that we have a response and data is ready to be retrieved?

      Dan Labrecque


        Ed Burns added a comment -

        I am no longer tracking progress of these projects on java.net.

        Ed Burns added a comment - I am no longer tracking progress of these projects on java.net.


          • Assignee:
            Ed Burns
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: