Tapestry 5
  1. Tapestry 5
  2. TAP5-779

CLONE -Linksubmit doesn't work inside a form with Zone parameter set

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.2
    • Fix Version/s: 5.2.0, 5.1.0.6, 5.1.0.7
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      This is a clone of TAP5-389 which was closed as CNR. This still IS an issue with 5.2-SNAPSHOT. Clicking on the link generated by linksubmit in the following example will not trigger linksubmit's selected event. The output is always just "form was submitted".

      <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
      <t:form zone="zone">
      <t:zone t:id="zone">
      <t:select value="type" />
      <t:linksubmit t:id="submit">submit</t:linksubmit>
      </t:zone>
      </t:form>
      </html>

      public class Test
      {
      public enum Types

      { TYPE1, TYPE2, TYPE3; }

      @Property private Types type;

      void onSelectedFromSubmit()

      { System.out.println("linksubmit was used"); }

      void onSuccess()

      { System.out.println("form was submitted"); }

      }

      1. TAP5-779.txt
        4 kB
        Ulrich Stärk
      2. TAP5-779-5.1.txt
        4 kB
        Ulrich Stärk

        Issue Links

          Activity

          Ulrich Stärk created issue -
          Ulrich Stärk made changes -
          Field Original Value New Value
          Link This issue is a clone of TAP5-389 [ TAP5-389 ]
          Ulrich Stärk made changes -
          Affects Version/s 5.2 [ 12313900 ]
          Affects Version/s 5.0.17 [ 12313530 ]
          Description When LinkSubmit is placed inside a form with Zone parameter, the following part of linksubmit.js will not do the right thing.

           if (onsubmit == undefined || onsubmit.call(window.document, event))
           {
               this.createHidden();
               this.form.submit();
          }

           createHidden() is not called so no hidden field is thus inserted.
           Removing 'zone' parameter from Form component fixed this immediately.
          This is a clone of TAP5-389 which was closed as CNR. This still IS an issue with 5.2-SNAPSHOT. Clicking on the link generated by linksubmit in the following example will not trigger linksubmit's selected event. The output is always just "form was submitted".

          <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
            <t:form zone="zone">
              <t:zone id="zone">
                <t:select value="type" />
                <t:linksubmit t:id="submit">submit</t:linksubmit>
              </t:zone>
            </t:form>
          </html>

          public class Test
          {
              public enum Types { TYPE1, TYPE2, TYPE3; }
              
              @Property private Types type;
              
              void onSelectedFromSubmit()
              {
                  System.out.println("linksubmit was used");
              }
              
              void onSuccess()
              {
                  System.out.println("form was submitted");
              }
          }

          Ulrich Stärk made changes -
          Description This is a clone of TAP5-389 which was closed as CNR. This still IS an issue with 5.2-SNAPSHOT. Clicking on the link generated by linksubmit in the following example will not trigger linksubmit's selected event. The output is always just "form was submitted".

          <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
            <t:form zone="zone">
              <t:zone id="zone">
                <t:select value="type" />
                <t:linksubmit t:id="submit">submit</t:linksubmit>
              </t:zone>
            </t:form>
          </html>

          public class Test
          {
              public enum Types { TYPE1, TYPE2, TYPE3; }
              
              @Property private Types type;
              
              void onSelectedFromSubmit()
              {
                  System.out.println("linksubmit was used");
              }
              
              void onSuccess()
              {
                  System.out.println("form was submitted");
              }
          }

          This is a clone of TAP5-389 which was closed as CNR. This still IS an issue with 5.2-SNAPSHOT. Clicking on the link generated by linksubmit in the following example will not trigger linksubmit's selected event. The output is always just "form was submitted".

          <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
            <t:form zone="zone">
              <t:zone t:id="zone">
                <t:select value="type" />
                <t:linksubmit t:id="submit">submit</t:linksubmit>
              </t:zone>
            </t:form>
          </html>

          public class Test
          {
              public enum Types { TYPE1, TYPE2, TYPE3; }
              
              @Property private Types type;
              
              void onSelectedFromSubmit()
              {
                  System.out.println("linksubmit was used");
              }
              
              void onSuccess()
              {
                  System.out.println("form was submitted");
              }
          }

          Hide
          Ulrich Stärk added a comment -

          Patch and Test. The previous test just confirmed that the form was submittedt but didn't check whether the selected event was fired. The new one does.

          Show
          Ulrich Stärk added a comment - Patch and Test. The previous test just confirmed that the form was submittedt but didn't check whether the selected event was fired. The new one does.
          Ulrich Stärk made changes -
          Attachment TAP5-779.txt [ 12418249 ]
          Ulrich Stärk made changes -
          Attachment TAP5-779.txt [ 12418249 ]
          Hide
          Ulrich Stärk added a comment -

          cleaned it up a bit

          Show
          Ulrich Stärk added a comment - cleaned it up a bit
          Ulrich Stärk made changes -
          Attachment TAP5-779.txt [ 12418253 ]
          Igor Drobiazko made changes -
          Assignee Howard M. Lewis Ship [ hlship ] Igor Drobiazko [ igor.drobiazko ]
          Igor Drobiazko made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Fix Version/s 5.2.0.0 [ 12314122 ]
          Resolution Fixed [ 1 ]
          Sergey Kashin made changes -
          Link This issue blocks TAP5-930 [ TAP5-930 ]
          Sergey Kashin made changes -
          Link This issue blocks TAP5-930 [ TAP5-930 ]
          Hide
          Ulrich Stärk added a comment -

          patch against 5.1 branch

          will conflict with the patch for TAP5-749 in linksubmit.js, so be sure to merge them correctly.

          Show
          Ulrich Stärk added a comment - patch against 5.1 branch will conflict with the patch for TAP5-749 in linksubmit.js, so be sure to merge them correctly.
          Ulrich Stärk made changes -
          Attachment TAP5-779-5.1.txt [ 12425480 ]
          Igor Drobiazko made changes -
          Fix Version/s 5.1.0.6 [ 12314399 ]
          Igor Drobiazko made changes -
          Fix Version/s 5.1.0.7 [ 12314494 ]

            People

            • Assignee:
              Igor Drobiazko
              Reporter:
              Ulrich Stärk
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development