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

Ajax Zone is improperly reloaded when a mixin submits form via JavaScript

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.3, 5.4
    • Fix Version/s: 5.4
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      Tapestry reloads the zone improperly if JS code
      Improperly submits the form. It should at least give some kind of an error
      or a warning when happens.
      Right now, it fails silently leading to an improper zone reload,
      which leads to weird errors when app is running subsequently.

      If form..setSubmittingElement(() isn't called before form.onsubmit(),
      the Tapestry silently fails and the zone is improperly reloaded.

      ---------------------------------------------------------------

      There was an addition of one line:
      $(this.formId).setSubmittingElement($(this.elementId)); // *** ADDED otherwise zone gets improperly reloaded
      $(this.formId).onsubmit(); // Submit Ajax form

      If you don't add the first line, the form is reloaded improperly after the zone update,
      so it doesn't work the second time.

      This is not documented anywhere, and really hard to debug.

      See threads:
      http://mail-archives.apache.org/mod_mbox/tapestry-users/201110.mbox/%3C21CB9971-ED77-4F37-9C72-501D0F5137B5@hope.nyc.ny.us%3E
      http://tapestry.1045711.n5.nabble.com/Mixins-stop-working-after-a-zone-update-please-help-td4935912.html

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              lprimak Lenny Primak
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: