You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Meier (JIRA)" <ji...@apache.org> on 2015/07/31 17:07:04 UTC

[jira] [Commented] (WICKET-5957) AjaxFormSubmitBehavior does not set setPreventDefault(true)

    [ https://issues.apache.org/jira/browse/WICKET-5957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14649309#comment-14649309 ] 

Sven Meier commented on WICKET-5957:
------------------------------------

The consensus of WICKET-5741 was that Wicket should not prevent the default in any case, the user code is responsible for that.

Note that if you add the AjaxFormSubmitBehavior to a button, you can simply change type="submit" to type="button" in the markup to prevent normal submit.

> AjaxFormSubmitBehavior does not set setPreventDefault(true)
> -----------------------------------------------------------
>
>                 Key: WICKET-5957
>                 URL: https://issues.apache.org/jira/browse/WICKET-5957
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 7.0.0
>            Reporter: Jens Weber
>            Assignee: Sven Meier
>
> In Wicket 7.0 the AjaxEventBehavior methods where adapted to the jQuery once with setPreventDefault and EventPropagation.BUBBLE.
> In Wicket 6.0 the default behavior was setAllowDefault(false), which migrates to setPreventDefault(true). In Wicket 7.0 setPreventDefault(false) is the default setting.
> In my opinion it is a bug if the AjaxFormSubmitBehavior does not set PreventDefault to true, because if I add the behavior I am expecting an ajax form submit and not a regular form submit. Otherwise I need to set for each AjaxFormSubmitBehavior usage the setPreventDefault(true).
> If it is not a bug than I the documentation must be adapted at AjaxFormSubmitBehavior in order to do a Ajax Form Submit.
> https://ci.apache.org/projects/wicket/guide/7.x/guide/single.html#ajax_3



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)