[ 
https://issues.apache.org/jira/browse/WICKET-5594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sven Meier resolved WICKET-5594.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 7.0.0-M2

non-Ajax hooks final now and non-Ajax submits are prevented with type="button"


> AjaxButton #onSubmit() #onError() intricacies
> ---------------------------------------------
>
>                 Key: WICKET-5594
>                 URL: https://issues.apache.org/jira/browse/WICKET-5594
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 7.0.0-M1
>            Reporter: Sven Meier
>            Assignee: Sven Meier
>            Priority: Trivial
>             Fix For: 7.0.0-M2
>
>
> 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?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to