Tapestry 5
  1. Tapestry 5
  2. TAP5-86

Add support for "cancel" submit buttons (which bypass client-side validation)


    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.15
    • Fix Version/s: 5.2.0
    • Component/s: None
    • Labels:


      There is a need for more submit types...
      although <input type="submit"> and <input type="reset"> are trivial even without a component,
      there is a problem when a type="cancel" is needed.

      The issue here is that in case of cancel client validation must be skipped, and that is not possible with current
      Submit component.

      I don't know how submit type=cancel works for T4 so I've implemented it how it seemed right for me.

      extract from javadoc for the "type" parameter

      • Determines the button behavior, <b>"submit"</b> - a normal form button, <b>"reset"</b> - reset form (locally),
      • "cancel" - works like an actionlink, generates a "cancel" event instead of "selected" and the form is not submitted
      • (if javascript is disabled form will be submitted, and "cancel" event fired as well),
      • <b>"submitcancel"</b> - works like "cancel" but behaves consistently with and without javascript
      • submission (this is usually desirable).

      input type=cancel uses javascript to redirect to an action link url, thus avoiding form submission,
      so I've added type=submitcancel which still submits the form but avoids client validation.

      both generate "cancel" event which is different from the "selected" event

      on top of all that the type=forced could be easily added to call "selected" event while skipping client side validation

      1. TAPESTRY-2109.patch
        6 kB
        Davor Hrg
      2. TAPESTRY-2109-R629196.patch
        6 kB
        Davor Hrg



          • Assignee:
            Howard M. Lewis Ship
            Davor Hrg
          • Votes:
            3 Vote for this issue
            4 Start watching this issue


            • Created: