You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Lars Vonk (JIRA)" <ji...@apache.org> on 2008/08/04 13:52:44 UTC

[jira] Created: (WICKET-1772) WicketTester ignores setDefaultFormSubmission when using executeAjaxEvent on an IFormSubmittingComponent

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.


[jira] Resolved: (WICKET-1772) WicketTester ignores setDefaultFormSubmission when using executeAjaxEvent on an IFormSubmittingComponent

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-1772.
-----------------------------------

      Assignee: Igor Vaynberg
    Resolution: Incomplete

this should be handled by the form submission logic and doesnt need to be handled that high up...please provide a quickstat

> 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
>            Assignee: Igor Vaynberg
>
> 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.