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

Pedro Santos updated WICKET-3418:
---------------------------------

    Attachment: WICKET-3418.patch

Sending the patch changing the setup order and removing asserting lines from 
AjaxSubmitLinkClickTest because wicket tester do not maintain request parameter 
between requests, even if they are originated by form components.

> Incorrect setting of AjaxSubmitLink's request parameter in 
> BaseWicketTester.submitAjaxFormSubmitBehavior
> --------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-3418
>                 URL: https://issues.apache.org/jira/browse/WICKET-3418
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.15
>            Reporter: Szádeczky-Kardoss Szabolcs
>            Assignee: Pedro Santos
>            Priority: Minor
>         Attachments: WICKET-3418.patch
>
>
> In BaseWicketTester.submitAjaxFormSubmitBehavior() the AjaxSubmitLink's name 
> is set in the request parameters as follows:
> (1)  Map<String, String[]> requestParams = getParametersForNextRequest();
>       requestParams.put(inputName, new String[] { "x" });
> However, as far as I could check 
> MockWebApplication's.parametersForNextRequest is only put into the actual 
> request when setupRequestAndResponse() is called. Since in clickLink()
> (2)  WebRequestCycle requestCycle = setupRequestAndResponse(true);
>       submitAjaxFormSubmitBehavior(linkComponent, ajaxFormSubmitBehavior);
> setupRequestAndResponse() precedes the submitAjaxFormSubmitBehavior() this 
> won't happen in the current request any more and the Ajax submit is not 
> processed correctly in the current request and also causes side effects for 
> the next form submit (ajax or normal).
> To solve it either replace (1) with:
>   getServletRequest().setParameter(inputName, new String[] { "x" });
> or change the order of the two lines in (2).

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to