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

Cancelling a form should skip server-side validation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.4.1
    • None
    • tapestry-core
    • None

    Description

      Ever since version 5.2, setting a Submit's (or LinkSubmit's) "mode" parameter to "cancel" causes Tapestry to skip client-side validation, but not server-side validation. This is counter-intuitive and leads to extra boiler-plate code to set a flag in onCancel() and check it in onValidate() to decide whether to perform server-side validatation. Instead, "cancel" should automatically skip server-side validation (triggering the cancel event instead of validate, success and failure events).

      For backward compatibility, a new symbol, "tapestry.form-cancel-client-only", will be false by default but can be overridden to true to restore the previous behavior.

      The existing mode="unconditional" setting will remain available for those cases where server-side validate, success and failure events should still be triggered (such as save as draft scenarios) without client-side validation.

      As part of this change, the documentation for Submit, LinkSubmit, EventConstants#CANCEL, SubmitMode#CANCEL and Form will be updated to remove the current ambiguities.

      Attachments

        Issue Links

          Activity

            People

              bobharner Bob Harner
              bobharner Bob Harner
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: