Tapestry
  1. Tapestry
  2. TAPESTRY-1517

form submitAsync doesn't set a JSON load handler

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.1.2
    • Component/s: JavaScript
    • Labels:
      None
    • Environment:
      client side browser

      Description

      tapestry.form.submitAsync is missing a critical piece for JSON responses:

      I studied the problem how to set callback function on the JSON response and
      I found that when JSON response is received no callback function is called.
      It happens only if json="true". This happens in the file form.js in
      submitAsync:function(form, content, submitName, parms) function. I think it
      should look like that:

      if (this.forms[formId].json || parms && parms.json) {
      kwArgs.headers=

      {"json":true}

      ;
      kwArgs.mimetype="text/json";
      ---> kwArgs.load=(function()

      {tapestry.loadJson.apply (this, arguments);}

      );
      } else {
      kwArgs.headers=

      {"dojo-ajax-request":true}

      ;
      kwArgs.mimetype="text/xml";
      kwArgs.load=(function()

      {tapestry.load.apply(this, arguments);}

      );
      }

      Is it bug?

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Jesse Kuhnert
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development