Bob Harner created TAP5-2539:
--------------------------------
Summary: Cancelling a form should skip server-side validation
Key: TAP5-2539
URL: https://issues.apache.org/jira/browse/TAP5-2539
Project: Tapestry 5
Issue Type: Improvement
Components: tapestry-core
Affects Versions: 5.4.1
Reporter: Bob Harner
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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)