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/03 16:05:59 UTC

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

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.


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

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2561?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2561.
-----------------------------------

    Resolution: Invalid

then use a Link since that is what you want, not a Button.

in IE if a button does not have a type="submit" it will not do anything - not even submit the form to the serverside.

> 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.


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

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773171#action_12773171 ] 

Igor Vaynberg commented on WICKET-2561:
---------------------------------------

have you tried with wicket-1.4.x snapshot?

> 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
>         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.


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

Posted by "Bart Duim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773410#action_12773410 ] 

Bart Duim commented on WICKET-2561:
-----------------------------------

I just checked 1.4-snapshot and it has the same problem.

> 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
>         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.


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

Posted by "Bart Duim (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2561?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bart Duim updated WICKET-2561:
------------------------------

    Attachment: myproject.zip

added a quickstart project

> 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
>         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.


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

Posted by "Bart Duim (JIRA)" <ji...@apache.org>.
     [ 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.


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

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2561?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2561.
-----------------------------------

    Resolution: Invalid
      Assignee: Igor Vaynberg

your markup is incorrect, your button tag is missing type="submit" attribute

> 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.