You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Bart Duim (JIRA)" <ji...@apache.org> on 2009/11/12 09:07:40 UTC

[jira] Reopened: (WICKET-2561) findSubmittingButton returns wrong button in multipart form in IE

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

Bart Duim reopened WICKET-2561:
-------------------------------


It is indeed correct that I forgot to add type="submit" to my button, but this does not fix the problem. Only if I add it to all the buttons (Ok and Cancel), this will work. But I really do not want to add it to the cancel button, because I don't want to submit the form if I click on cancel, especially if you have a file upload.

> findSubmittingButton returns wrong button in multipart form in IE 
> ------------------------------------------------------------------
>
>                 Key: WICKET-2561
>                 URL: https://issues.apache.org/jira/browse/WICKET-2561
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.2, 1.4.3
>            Reporter: Bart Duim
>            Assignee: Igor Vaynberg
>         Attachments: myproject.zip
>
>
> I wanted to create a page which uploads a file. For this, I created a form that has two buttons, a cancel and a ok button. The DefaultFormProcessing of the cancel button was set to false. This turned out to be a problem, in Internet Explorer the onSubmit (and onValidate) of the form was never called when ok was clicked.
> In multipart IE sends not only the clicked button in the request, but also all the other buttons. In findSubmittingButton() Wicket checks all the children of the page, to see if it is present as a parameter in the request. In the case of IE this wil allways return the first button that is in the request, and not the clicked button.
> Possible solution would be to make sure the request in IE contains only the clicked button, but my javascript skills are way to bad for that. 
> An other solution would be to check for the right value of the request parameter, but i don't know if every browser will send the same value.
> request (via Fiddler) when clicked in IE:
> -----------------------------7d92a027a08b2
> Content-Disposition: form-data; name="simpleForm1_hf_0"
> -----------------------------7d92a027a08b2
> Content-Disposition: form-data; name="input1"
> input here
> -----------------------------7d92a027a08b2
> Content-Disposition: form-data; name="cancel_button"
> cancel_button
> -----------------------------7d92a027a08b2
> Content-Disposition: form-data; name="ok_button"
> ok_button
> -----------------------------7d92a027a08b2
> Content-Disposition: form-data; name="ok_button"
> 1
> -----------------------------7d92a027a08b2--
> request when ok is clicked in Firefox:
> -----------------------------21991321967783
> Content-Disposition: form-data; name="simpleForm1_hf_0"
> -----------------------------21991321967783
> Content-Disposition: form-data; name="input1"
> input here
> -----------------------------21991321967783
> Content-Disposition: form-data; name="ok_button"
> 1
> -----------------------------21991321967783--

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