WicketTester ignores setDefaultFormSubmission when using executeAjaxEvent on an 
IFormSubmittingComponent 
---------------------------------------------------------------------------------------------------------

                 Key: WICKET-1772
                 URL: https://issues.apache.org/jira/browse/WICKET-1772
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4-M3
         Environment: jdk.1.5, winxp
            Reporter: Lars Vonk


When for instance an AjaxButton has set its defaultFormProcessing to false, 
WicketTester still submits the form when firing an executeAjaxEvent(). 

To fix this I extended the WicketTester and in the method public void 
executeAjaxEvent(Component component, String event) I replaced:

        // If the event is an FormSubmitBehavior then also "submit" the form
        if (ajaxEventBehavior instanceof AjaxFormSubmitBehavior && submit)
        {
            AjaxFormSubmitBehavior ajaxFormSubmitBehavior = 
(AjaxFormSubmitBehavior)ajaxEventBehavior;
            submitAjaxFormSubmitBehavior(ajaxFormSubmitBehavior);
        }

with:

        boolean submit = true;
        if(component instanceof IFormSubmittingComponent) {
            submit = 
((IFormSubmittingComponent)component).getDefaultFormProcessing();
        }
        // If the event is an FormSubmitBehavior then also "submit" the form
        if (ajaxEventBehavior instanceof AjaxFormSubmitBehavior && submit)
        {
            AjaxFormSubmitBehavior ajaxFormSubmitBehavior = 
(AjaxFormSubmitBehavior)ajaxEventBehavior;
            submitAjaxFormSubmitBehavior(ajaxFormSubmitBehavior);
        }




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to