You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Tomas Bilka (Created) (JIRA)" <ji...@apache.org> on 2012/02/16 20:10:59 UTC

[jira] [Created] (WICKET-4413) Form.setMultiPart(false) does not set the multiPart field to 0

Form.setMultiPart(false) does not set the multiPart field to 0
--------------------------------------------------------------

                 Key: WICKET-4413
                 URL: https://issues.apache.org/jira/browse/WICKET-4413
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5.3
         Environment: Windows 7 (64 bit), Intel i3 platform
            Reporter: Tomas Bilka


My expectation is that by calling setMutliPart(false) the mutliPart field in Form component shoudl be set to 0.

This line of code from org.apache.wicket.markup.html.form.Form<T>: multiPart &= ~MULTIPART_HARD; is probably trying to reset the multiPart to 0 (this is how i understand it), but it fails to do so since
~MULTIPART_HARD == 11111111111111111111111111111110  (initial value of MULTIPART_HARD is 1 or 0000000000000000000000000000001 in binary) in binary

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4413) Form.setMultiPart(false) does not set the multiPart field to 0

Posted by "Martin Grigorov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211880#comment-13211880 ] 

Martin Grigorov commented on WICKET-4413:
-----------------------------------------

Ask in dev@ mailling list.
Maybe I understand wrongly the logic in #setMultiPart(). Hopefully some of the older devs can bring more light in the matter.
                
> Form.setMultiPart(false) does not set the multiPart field to 0
> --------------------------------------------------------------
>
>                 Key: WICKET-4413
>                 URL: https://issues.apache.org/jira/browse/WICKET-4413
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows 7 (64 bit), Intel i3 platform
>            Reporter: Tomas Bilka
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> My expectation is that by calling setMutliPart(false) the mutliPart field in Form component should be set to 0.
> This line of code from org.apache.wicket.markup.html.form.Form<T>: multiPart &= ~MULTIPART_HARD; is probably trying to reset the multiPart to 0 (this is how i understand it), but it fails to do so since
> ~MULTIPART_HARD == 11111111111111111111111111111110  (initial value of MULTIPART_HARD is 1 or 0000000000000000000000000000001 in binary)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4413) Form.setMultiPart(false) does not set the multiPart field to 0

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

Martin Grigorov resolved WICKET-4413.
-------------------------------------

    Resolution: Not A Problem

Form#setMultiPart() switches on/off MULTIPART_HARD flag.
But a Form still can be multipart if any of its nested forms is multipart. In this case MULTIPART_HINT is set and it should not be reset manually with setMultiPart(false).
                
> Form.setMultiPart(false) does not set the multiPart field to 0
> --------------------------------------------------------------
>
>                 Key: WICKET-4413
>                 URL: https://issues.apache.org/jira/browse/WICKET-4413
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows 7 (64 bit), Intel i3 platform
>            Reporter: Tomas Bilka
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> My expectation is that by calling setMutliPart(false) the mutliPart field in Form component should be set to 0.
> This line of code from org.apache.wicket.markup.html.form.Form<T>: multiPart &= ~MULTIPART_HARD; is probably trying to reset the multiPart to 0 (this is how i understand it), but it fails to do so since
> ~MULTIPART_HARD == 11111111111111111111111111111110  (initial value of MULTIPART_HARD is 1 or 0000000000000000000000000000001 in binary)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4413) Form.setMultiPart(false) does not set the multiPart field to 0

Posted by "Tomas Bilka (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211853#comment-13211853 ] 

Tomas Bilka commented on WICKET-4413:
-------------------------------------

Actaully I started this ticket because I needed a possibility to force the Form to be set as non-multipart, even if it contains a nested multipart component.

In my case I had an inner form as part of a modal window. I could not remove it from being part if its outer form. So when a modal window pops up there there was
its form with FileUplaodField. User uploads the file then closes the modal window. Then does some other inputs on outer form, then submit the outer form.

When submiting outer form, there was en exception dont remeber now that it was something like "..wicket tries it bests to resolve the mutlipart " (or something like that).

Is there a way to achieve a correct behaviour when having this hierarchy of component in some other way then forcefully set multiPart filed on Form component ?
                
> Form.setMultiPart(false) does not set the multiPart field to 0
> --------------------------------------------------------------
>
>                 Key: WICKET-4413
>                 URL: https://issues.apache.org/jira/browse/WICKET-4413
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows 7 (64 bit), Intel i3 platform
>            Reporter: Tomas Bilka
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> My expectation is that by calling setMutliPart(false) the mutliPart field in Form component should be set to 0.
> This line of code from org.apache.wicket.markup.html.form.Form<T>: multiPart &= ~MULTIPART_HARD; is probably trying to reset the multiPart to 0 (this is how i understand it), but it fails to do so since
> ~MULTIPART_HARD == 11111111111111111111111111111110  (initial value of MULTIPART_HARD is 1 or 0000000000000000000000000000001 in binary)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4413) Form.setMultiPart(false) does not set the multiPart field to 0

Posted by "Martin Grigorov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211855#comment-13211855 ] 

Martin Grigorov commented on WICKET-4413:
-----------------------------------------

Override org.apache.wicket.markup.html.form.Form#isMultiPart() .
                
> Form.setMultiPart(false) does not set the multiPart field to 0
> --------------------------------------------------------------
>
>                 Key: WICKET-4413
>                 URL: https://issues.apache.org/jira/browse/WICKET-4413
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows 7 (64 bit), Intel i3 platform
>            Reporter: Tomas Bilka
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> My expectation is that by calling setMutliPart(false) the mutliPart field in Form component should be set to 0.
> This line of code from org.apache.wicket.markup.html.form.Form<T>: multiPart &= ~MULTIPART_HARD; is probably trying to reset the multiPart to 0 (this is how i understand it), but it fails to do so since
> ~MULTIPART_HARD == 11111111111111111111111111111110  (initial value of MULTIPART_HARD is 1 or 0000000000000000000000000000001 in binary)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4413) Form.setMultiPart(false) does not set the multiPart field to 0

Posted by "Tomas Bilka (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211867#comment-13211867 ] 

Tomas Bilka commented on WICKET-4413:
-------------------------------------

I was thinking about this possibility but it seemed harder to do it the right way. There can be other mutlipart components as direct child of outer form, which would then require to 
preserve the scanning of component hierarchy as it is done now in isMutliPart, later I would just programatically decide which multipart component was triggered and reset the
flag accordingly if it was the modal window component.

The point is that by overriding the isMultiPart I woudl be forced to copy basically whole content of the isMutliPart to the override method (to preserve the component scan).

I am not saying I will do this horror in my app, but this is what lead me to wanting to be able to force setting the multiPart flag.

                
> Form.setMultiPart(false) does not set the multiPart field to 0
> --------------------------------------------------------------
>
>                 Key: WICKET-4413
>                 URL: https://issues.apache.org/jira/browse/WICKET-4413
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows 7 (64 bit), Intel i3 platform
>            Reporter: Tomas Bilka
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> My expectation is that by calling setMutliPart(false) the mutliPart field in Form component should be set to 0.
> This line of code from org.apache.wicket.markup.html.form.Form<T>: multiPart &= ~MULTIPART_HARD; is probably trying to reset the multiPart to 0 (this is how i understand it), but it fails to do so since
> ~MULTIPART_HARD == 11111111111111111111111111111110  (initial value of MULTIPART_HARD is 1 or 0000000000000000000000000000001 in binary)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4413) Form.setMultiPart(false) does not set the multiPart field to 0

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

Tomas Bilka updated WICKET-4413:
--------------------------------

           Description: 
My expectation is that by calling setMutliPart(false) the mutliPart field in Form component should be set to 0.

This line of code from org.apache.wicket.markup.html.form.Form<T>: multiPart &= ~MULTIPART_HARD; is probably trying to reset the multiPart to 0 (this is how i understand it), but it fails to do so since
~MULTIPART_HARD == 11111111111111111111111111111110  (initial value of MULTIPART_HARD is 1 or 0000000000000000000000000000001 in binary)

  was:
My expectation is that by calling setMutliPart(false) the mutliPart field in Form component shoudl be set to 0.

This line of code from org.apache.wicket.markup.html.form.Form<T>: multiPart &= ~MULTIPART_HARD; is probably trying to reset the multiPart to 0 (this is how i understand it), but it fails to do so since
~MULTIPART_HARD == 11111111111111111111111111111110  (initial value of MULTIPART_HARD is 1 or 0000000000000000000000000000001 in binary) in binary

    Remaining Estimate: 168h  (was: 1h)
     Original Estimate: 168h  (was: 1h)
    
> Form.setMultiPart(false) does not set the multiPart field to 0
> --------------------------------------------------------------
>
>                 Key: WICKET-4413
>                 URL: https://issues.apache.org/jira/browse/WICKET-4413
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows 7 (64 bit), Intel i3 platform
>            Reporter: Tomas Bilka
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> My expectation is that by calling setMutliPart(false) the mutliPart field in Form component should be set to 0.
> This line of code from org.apache.wicket.markup.html.form.Form<T>: multiPart &= ~MULTIPART_HARD; is probably trying to reset the multiPart to 0 (this is how i understand it), but it fails to do so since
> ~MULTIPART_HARD == 11111111111111111111111111111110  (initial value of MULTIPART_HARD is 1 or 0000000000000000000000000000001 in binary)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4413) Form.setMultiPart(false) does not set the multiPart field to 0

Posted by "Tomas Bilka (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211913#comment-13211913 ] 

Tomas Bilka commented on WICKET-4413:
-------------------------------------

I dont want to confuse this more then necessary, but one more comment to this.

If the component is having a permanently visible mutlipart component as part of its outer form then i think the problem does not exist 
(at least the "...Wicket tries its best to auto-detect multipart..." exception will be gone), since the page will be marked alwasy as mutliPart

Problem is when there is no multipart component in the outer form and there is a multipart component as part of some other, potentitally
non visible, component  (like modal window).

In that case i would just override the isMultiPart as Martin suggested (and by overriding i mean some "simple" override not needing to preserve
component scan).

Only problem  I see is when in the future someone decides to add a mutlipart component to the outer form. Then the overriden isMultiPart method
would need to be removed to re-enable component scan.




                
> Form.setMultiPart(false) does not set the multiPart field to 0
> --------------------------------------------------------------
>
>                 Key: WICKET-4413
>                 URL: https://issues.apache.org/jira/browse/WICKET-4413
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows 7 (64 bit), Intel i3 platform
>            Reporter: Tomas Bilka
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> My expectation is that by calling setMutliPart(false) the mutliPart field in Form component should be set to 0.
> This line of code from org.apache.wicket.markup.html.form.Form<T>: multiPart &= ~MULTIPART_HARD; is probably trying to reset the multiPart to 0 (this is how i understand it), but it fails to do so since
> ~MULTIPART_HARD == 11111111111111111111111111111110  (initial value of MULTIPART_HARD is 1 or 0000000000000000000000000000001 in binary)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4413) Form.setMultiPart(false) does not set the multiPart field to 0

Posted by "Tomas Bilka (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211158#comment-13211158 ] 

Tomas Bilka commented on WICKET-4413:
-------------------------------------

One clarification. The reset to 0 works when the multiPart value is 1 (0000000000000000000000000000001b) but it does not work for multipart of value 2 (0000000000000000000000000000010b).
For value 2, after "AND"ing with ~MULTIPART_HARD == 11111111111111111111111111111110b, the result would be  0000000000000000000000000000010b which is still 2.
                
> Form.setMultiPart(false) does not set the multiPart field to 0
> --------------------------------------------------------------
>
>                 Key: WICKET-4413
>                 URL: https://issues.apache.org/jira/browse/WICKET-4413
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows 7 (64 bit), Intel i3 platform
>            Reporter: Tomas Bilka
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> My expectation is that by calling setMutliPart(false) the mutliPart field in Form component should be set to 0.
> This line of code from org.apache.wicket.markup.html.form.Form<T>: multiPart &= ~MULTIPART_HARD; is probably trying to reset the multiPart to 0 (this is how i understand it), but it fails to do so since
> ~MULTIPART_HARD == 11111111111111111111111111111110  (initial value of MULTIPART_HARD is 1 or 0000000000000000000000000000001 in binary)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira