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

Forms in zones in loops have wrong zone id after update

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.0.12
    • 5.0.13
    • tapestry-core
    • None

    Description

      When having a loop with forms in zones as in

      <t:loop source="...">
      <t:zone t:id="zone">
      <t:form t:id="f" t:zone="prop:zone.clientid">
      ...
      </t:form>
      </t:zone>
      </t:loop>

      The form updates the zone correctly on the first submit. The update handler returns the form (this is simpler in my application, as the zone/form is in a separate component) as in

      @Component
      private Form _f;

      Object onSuccess() {
      ....
      return _f;
      }

      The return value contains the markup + a script to link the form to the zone again. At this point the form does not know what the id was of the original zone, and returns a zone name of the form "zone:<number>". As the zone cannot be found, the whole page is refreshed when submitting the form a second time.

      To solve this from the user perspective one possibility to set the client id used for the zone explicitly, but this may cause problems with uniqueness of names.

      Ideally the javascript will return the zone id in the AJAX request, so that it is not necessary to track the zone id in the application. The javascript linking the form to the zone could then use the correct zone id.

      Thanks,

      Adriaan

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            adriaanjoubert Adriaan Joubert
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: