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.3, 1.4.2
Reporter: Bart Duim
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.