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 2010/11/12 15:47:14 UTC

[jira] Updated: (WICKET-3156) Submitting button of a multiple-button form is not resolved correctly

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

Pedro Santos updated WICKET-3156:
---------------------------------

    Attachment: test-WICKET-3156.patch

Hi Ivan, you're forgetting to consider that the browser adds the submit component  input name as an request parameter. So the findSubmittingButton will find the correct submitting component. Anyway, I'm sending an test case to show it and prevent this kind of bug from happen. Try to break it, and if you can, send back how.

> Submitting button of a multiple-button form is not resolved correctly
> ---------------------------------------------------------------------
>
>                 Key: WICKET-3156
>                 URL: https://issues.apache.org/jira/browse/WICKET-3156
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-M3
>            Reporter: Ivan Vasilev
>         Attachments: test-WICKET-3156.patch
>
>
> This bug affects Form.findSubmittingButton().
> Inside it all the form submitting children of the page are visited. A check is made whether the current form submitting component is a child of the current form. 
> If so another check is performed:
> 	if ((!parameters.getParameterValue(name).isNull()) ||
> 		!parameters.getParameterValue(name + ".x").isNull())
> I saw that in case of a button the condition !parameters.getParameterValue(name).isNull()) is true (returns the "value" attribute of the button), so the button can be considered the submitting component of the form.
> However if there are multiple buttons in the form in this case the first visited button will be returned, which is not necessary the one that actually submitted the form.

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