You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Pedro Santos (JIRA)" <ji...@apache.org> on 2011/02/20 23:02:38 UTC

[jira] Issue Comment Edited: (WICKET-3418) Incorrect setting of AjaxSubmitLink's request parameter in BaseWicketTester.submitAjaxFormSubmitBehavior

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

Pedro Santos edited comment on WICKET-3418 at 2/20/11 10:01 PM:
----------------------------------------------------------------

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 would be originated by browser to form components on page.

      was (Author: pedrosans):
    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