Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
5.4.1
-
None
-
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
- is related to
-
TAP5-1856 Documentation for SubmitMode.CANCEL is out of date w.r.t. new 5.3 form cancel logic
- Resolved
-
TAP5-1503 Submit/LinkSubmit's SubmitMode ("mode") parameter does not work serverside
- Closed
-
TAP5-86 Add support for "cancel" submit buttons (which bypass client-side validation)
- Closed
-
TAP5-1604 A Form should not continue processing after the canceled event is triggered
- Closed
-
TAP5-1451 Form component should indicate that a form submission was canceled on the client side
- Closed