Tapestry
  1. Tapestry
  2. TAPESTRY-2360

Forms in zones in loops have wrong zone id after update

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.12
    • Fix Version/s: 5.0.13
    • Component/s: tapestry-core
    • Labels:
      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

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        I think the right fix here is that if you explicitly specify the zone's id (via the id parameter), it is used exactly as provided.

        Show
        Howard M. Lewis Ship added a comment - I think the right fix here is that if you explicitly specify the zone's id (via the id parameter), it is used exactly as provided.

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Adriaan Joubert
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development