Description
Overriding AjaxButton's hook #onSubmit() is prone to possible programming errors:
- with JavaScript enabled, #onSubmit() will not be called, leaving the developer without clue that the wrong method was overwritten
- with JavaScript disabled, #onSubmit(ART, Form) will not be called - furthermore if the markup includes type="submit" or no type attribute, #onSubmit() will be called instead.
#onError() and #onError(ART, Form) have identical intricacies.
To make things consistent I propose the following change for Wicket 7.x:
- declare #onSubmit() and #onError() final on AjaxButton
- in #onComponentTag() make sure the <button>-Tag has type="button", so the browser does not submit the form when JavaScript is disabled. For fallack support we have AjaxFallbackButton already.
Any objections or better ideas?
Attachments
Issue Links
- breaks
-
WICKET-6139 AjaxButton forces rendering type="button"
- Resolved
- relates to
-
WICKET-5597 button behaviour changed
- Resolved