You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by exl <er...@uwa.edu.au> on 2011/01/18 11:43:49 UTC

Multipart issues in Wicket 1.4.15

Encountering a show stopper for our project that involves being able to deal
with a form containing a file upload that can be revealed depending on
whether that particular workflow is desired.  

Please see attached quickstart project that shows this failing using Wicket
version 1.4.15 (
http://apache-wicket.1842946.n4.nabble.com/file/n3221308/nestedFormsWithMultipart.zip
nestedFormsWithMultipart.zip ).  Basically, first click on the New button to
reveal the hidden form (that has the file upload).  Now hit the Cancel
button and the form is hidden. Ok, but now if you click on New again the an
multipart exception is thrown.

This may be somewhat related to "Nested Forms and Multipart Fileupload
Issue"
(http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p1844365.html),
but a quick read of that thread suggest it is dealing with modal stuff (thus
I created this post).

I think this is a bug, as I don't remember this failing in the previous
version we were using (Wicket 1.4.9) - though this is still to be confirmed.

-----

Eric is learning how to use Wicket and enjoying the experience so far...
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Multipart-issues-in-Wicket-1-4-15-tp3221308p3221308.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Multipart issues in Wicket 1.4.15

Posted by Igor Vaynberg <ig...@gmail.com>.
in 1.4.9 it worked because we did not take visibility of children into
account. eg an invisible multipart component would make the form
multipart as well. this was inconsistent so it was fixed.

as far as automatic detection - i think in this case it happens during
an ajax update and going from non-multipart to multipart would require
the form tag to be updated to add the encoding. if axl updated the
formtag via ajax then everything would work, but i dont think it is
the case.

-igor


On Tue, Jan 18, 2011 at 9:12 PM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> On Tue, Jan 18, 2011 at 11:08 PM, Arjun Dhar <dh...@yahoo.com> wrote:
>
>>
>> Hi am not sure if a user vote is going on here.
>>
>
> Nah - a vote would have [VOTE] in the subject, and they are typically only
> on the dev@ list, not users@.  But, we're *always* open to feedback here.
>
> My 2 cents for my own insecurities: Leave it as is! Its good enough.
>> I'm pretty much screwing around with FileUpload in many ways and overall
>> its
>> great.
>>
>
> Well, that's the thing.  According to the original poster, the functionality
> differs between 1.4.9 and 1.4.15.  So, if that's the case, this was a minor
> regression.  So, which way should it be?  Well, that's what I'm asking :)
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Multipart issues in Wicket 1.4.15

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Tue, Jan 18, 2011 at 11:08 PM, Arjun Dhar <dh...@yahoo.com> wrote:

>
> Hi am not sure if a user vote is going on here.
>

Nah - a vote would have [VOTE] in the subject, and they are typically only
on the dev@ list, not users@.  But, we're *always* open to feedback here.

My 2 cents for my own insecurities: Leave it as is! Its good enough.
> I'm pretty much screwing around with FileUpload in many ways and overall
> its
> great.
>

Well, that's the thing.  According to the original poster, the functionality
differs between 1.4.9 and 1.4.15.  So, if that's the case, this was a minor
regression.  So, which way should it be?  Well, that's what I'm asking :)

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

Re: Multipart issues in Wicket 1.4.15

Posted by Arjun Dhar <dh...@yahoo.com>.
Hi am not sure if a user vote is going on here. 

My 2 cents for my own insecurities: Leave it as is! Its good enough.
I'm pretty much screwing around with FileUpload in many ways and overall its
great.

thanks

-----
Don't take life too seriously, your'e not getting out it alive anyway!
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Multipart-issues-in-Wicket-1-4-15-tp3221308p3224563.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Multipart issues in Wicket 1.4.15

Posted by exl <er...@uwa.edu.au>.
As an after thought, I'm leaning towards leaving 1.4.15 the way it is.  I
like the idea of having greater control over the multipart settings,
assuming developers know when to enable it and when not to.  For example, if
I had another nested form that doesn't involve a file upload, then I'm
thinking that I should be able to disable the multipart on the root form if
this non-upload nested form is being shown (rather than always have the
multipart set to true for the entire lifetime of the root form).  Unless the
automatic setting of multipart is always reliable in all use cases, then
leaving it the way it is in 1.4.15 allows developers to better understand
and control when the multipart setting should be applied or not.  That's my
two cents anyway.

-----

Eric is learning how to use Wicket and enjoying the experience so far...
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Multipart-issues-in-Wicket-1-4-15-tp3221308p3224553.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Multipart issues in Wicket 1.4.15

Posted by exl <er...@uwa.edu.au>.
Well as per Pedro and Igor's observation - if I setMultiPart(true) on the
root form on initialisation, then I don't encounter exceptions any more
using Wicket 1.4.15.  I've applied this in our main development project and
it seems to work fine.

As a quick test, I switched back to Wicket version 1.4.9 for our main
development project and also reverted the above change (removed that
setMultiPart(true) on our root form).  The same kind of workflow worked
without throwing a multipart related exception, so I suspect that in 1.4.9
the automatic multipart detection was able to correctly update the root form
multipart setting.  

This is not to say that 1.4.9 is the correct behaviour, since I'm thinking
that perhaps 1.4.15 enables greater manual control over how multipart works
on each form. So I think Jeremy (and Pedro earlier?) asks a valid question
as to whether the FileUpload should always be automatically updating the
root form multipart properties depending on the FileUpload field being
enabled and visible. As long as I can understand the expected behaviour,
then either way should be fine as long as I can still do what I want to do
:)

Let us know what is decided...

-----

Eric is learning how to use Wicket and enjoying the experience so far...
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Multipart-issues-in-Wicket-1-4-15-tp3221308p3224533.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Multipart issues in Wicket 1.4.15

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Should we set the parent form to multipart somewhere around the
post-configure / pre-render of a FileUpload?  It could find its parent Form
and do it automatically.  I guess the question is really: is there anytime
that we *wouldn't* want that to happen automatically?  If we do it
post-configure / pre-render, we can do it anytime there is a visible file
upload field.

On Tue, Jan 18, 2011 at 6:31 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> what about cases where users swap in an upload field later? in this
> case visibility isnt going to help. this is why we provide a way for
> the user to hard-set the value to true via form.setmultipart(true) -
> which is what i think exl should do.
>
> -igor
>
> On Tue, Jan 18, 2011 at 3:41 PM, Pedro Santos <pe...@gmail.com> wrote:
> > I tested the quickstart with the HomeForm multipart property set to true
> and
> > it is all ok.
> > I'm 1+ to change Form#isMultipart implementation to don't test the form
> > components visibility while visiting children. It is quite natural to
> have
> > them set to true and sent back to browser in an AJAX response, in which
> case
> > the form can possible do not have the correspondent enctype tag
> attribute.
> >
> > On Tue, Jan 18, 2011 at 3:43 PM, Pedro Santos <pe...@gmail.com>
> wrote:
> >
> >> Set the root form as multipart in the onInitialize method, Wicket will
> fail
> >> in detect the form as multipart if the inner one with the upload field
> is
> >> not visible at the first render.
> >>
> >> On Tue, Jan 18, 2011 at 8:43 AM, exl <er...@uwa.edu.au> wrote:
> >>
> >>>
> >>> Encountering a show stopper for our project that involves being able to
> >>> deal
> >>> with a form containing a file upload that can be revealed depending on
> >>> whether that particular workflow is desired.
> >>>
> >>> Please see attached quickstart project that shows this failing using
> >>> Wicket
> >>> version 1.4.15 (
> >>>
> >>>
> http://apache-wicket.1842946.n4.nabble.com/file/n3221308/nestedFormsWithMultipart.zip
> >>> nestedFormsWithMultipart.zip ).  Basically, first click on the New
> button
> >>> to
> >>> reveal the hidden form (that has the file upload).  Now hit the Cancel
> >>> button and the form is hidden. Ok, but now if you click on New again
> the
> >>> an
> >>> multipart exception is thrown.
> >>>
> >>> This may be somewhat related to "Nested Forms and Multipart Fileupload
> >>> Issue"
> >>> (
> >>>
> http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p1844365.html
> >>> ),
> >>> but a quick read of that thread suggest it is dealing with modal stuff
> >>> (thus
> >>> I created this post).
> >>>
> >>> I think this is a bug, as I don't remember this failing in the previous
> >>> version we were using (Wicket 1.4.9) - though this is still to be
> >>> confirmed.
> >>>
> >>> -----
> >>>
> >>> Eric is learning how to use Wicket and enjoying the experience so
> far...
> >>> --
> >>> View this message in context:
> >>>
> http://apache-wicket.1842946.n4.nabble.com/Multipart-issues-in-Wicket-1-4-15-tp3221308p3221308.html
> >>> Sent from the Users forum mailing list archive at Nabble.com.
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>
> >>>
> >>
> >>
> >> --
> >> Pedro Henrique Oliveira dos Santos
> >>
> >
> >
> >
> > --
> > Pedro Henrique Oliveira dos Santos
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

Re: Multipart issues in Wicket 1.4.15

Posted by exl <er...@uwa.edu.au>.
Ok.  So Igor you're basically saying that as long as there is a possibility
for a file upload, the root form should always be setMultiPart(true) as part
of initialisation.  I guess this means it is not a bug? (if so, then I won't
add this to your bug tracking).

I should mention that it will be possible to do perform a separate workflow
(not implemented here) that will not require a file upload (i.e. where the
hidden form remains hidden).  I'm going to test this suggestion out in our
main development project and send another update shortly.

-----

Eric is learning how to use Wicket and enjoying the experience so far...
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Multipart-issues-in-Wicket-1-4-15-tp3221308p3224483.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Multipart issues in Wicket 1.4.15

Posted by Igor Vaynberg <ig...@gmail.com>.
what about cases where users swap in an upload field later? in this
case visibility isnt going to help. this is why we provide a way for
the user to hard-set the value to true via form.setmultipart(true) -
which is what i think exl should do.

-igor

On Tue, Jan 18, 2011 at 3:41 PM, Pedro Santos <pe...@gmail.com> wrote:
> I tested the quickstart with the HomeForm multipart property set to true and
> it is all ok.
> I'm 1+ to change Form#isMultipart implementation to don't test the form
> components visibility while visiting children. It is quite natural to have
> them set to true and sent back to browser in an AJAX response, in which case
> the form can possible do not have the correspondent enctype tag attribute.
>
> On Tue, Jan 18, 2011 at 3:43 PM, Pedro Santos <pe...@gmail.com> wrote:
>
>> Set the root form as multipart in the onInitialize method, Wicket will fail
>> in detect the form as multipart if the inner one with the upload field is
>> not visible at the first render.
>>
>> On Tue, Jan 18, 2011 at 8:43 AM, exl <er...@uwa.edu.au> wrote:
>>
>>>
>>> Encountering a show stopper for our project that involves being able to
>>> deal
>>> with a form containing a file upload that can be revealed depending on
>>> whether that particular workflow is desired.
>>>
>>> Please see attached quickstart project that shows this failing using
>>> Wicket
>>> version 1.4.15 (
>>>
>>> http://apache-wicket.1842946.n4.nabble.com/file/n3221308/nestedFormsWithMultipart.zip
>>> nestedFormsWithMultipart.zip ).  Basically, first click on the New button
>>> to
>>> reveal the hidden form (that has the file upload).  Now hit the Cancel
>>> button and the form is hidden. Ok, but now if you click on New again the
>>> an
>>> multipart exception is thrown.
>>>
>>> This may be somewhat related to "Nested Forms and Multipart Fileupload
>>> Issue"
>>> (
>>> http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p1844365.html
>>> ),
>>> but a quick read of that thread suggest it is dealing with modal stuff
>>> (thus
>>> I created this post).
>>>
>>> I think this is a bug, as I don't remember this failing in the previous
>>> version we were using (Wicket 1.4.9) - though this is still to be
>>> confirmed.
>>>
>>> -----
>>>
>>> Eric is learning how to use Wicket and enjoying the experience so far...
>>> --
>>> View this message in context:
>>> http://apache-wicket.1842946.n4.nabble.com/Multipart-issues-in-Wicket-1-4-15-tp3221308p3221308.html
>>> Sent from the Users forum mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>>
>> --
>> Pedro Henrique Oliveira dos Santos
>>
>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Multipart issues in Wicket 1.4.15

Posted by Pedro Santos <pe...@gmail.com>.
I tested the quickstart with the HomeForm multipart property set to true and
it is all ok.
I'm 1+ to change Form#isMultipart implementation to don't test the form
components visibility while visiting children. It is quite natural to have
them set to true and sent back to browser in an AJAX response, in which case
the form can possible do not have the correspondent enctype tag attribute.

On Tue, Jan 18, 2011 at 3:43 PM, Pedro Santos <pe...@gmail.com> wrote:

> Set the root form as multipart in the onInitialize method, Wicket will fail
> in detect the form as multipart if the inner one with the upload field is
> not visible at the first render.
>
> On Tue, Jan 18, 2011 at 8:43 AM, exl <er...@uwa.edu.au> wrote:
>
>>
>> Encountering a show stopper for our project that involves being able to
>> deal
>> with a form containing a file upload that can be revealed depending on
>> whether that particular workflow is desired.
>>
>> Please see attached quickstart project that shows this failing using
>> Wicket
>> version 1.4.15 (
>>
>> http://apache-wicket.1842946.n4.nabble.com/file/n3221308/nestedFormsWithMultipart.zip
>> nestedFormsWithMultipart.zip ).  Basically, first click on the New button
>> to
>> reveal the hidden form (that has the file upload).  Now hit the Cancel
>> button and the form is hidden. Ok, but now if you click on New again the
>> an
>> multipart exception is thrown.
>>
>> This may be somewhat related to "Nested Forms and Multipart Fileupload
>> Issue"
>> (
>> http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p1844365.html
>> ),
>> but a quick read of that thread suggest it is dealing with modal stuff
>> (thus
>> I created this post).
>>
>> I think this is a bug, as I don't remember this failing in the previous
>> version we were using (Wicket 1.4.9) - though this is still to be
>> confirmed.
>>
>> -----
>>
>> Eric is learning how to use Wicket and enjoying the experience so far...
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/Multipart-issues-in-Wicket-1-4-15-tp3221308p3221308.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>



-- 
Pedro Henrique Oliveira dos Santos

Re: Multipart issues in Wicket 1.4.15

Posted by Pedro Santos <pe...@gmail.com>.
Set the root form as multipart in the onInitialize method, Wicket will fail
in detect the form as multipart if the inner one with the upload field is
not visible at the first render.

On Tue, Jan 18, 2011 at 8:43 AM, exl <er...@uwa.edu.au> wrote:

>
> Encountering a show stopper for our project that involves being able to
> deal
> with a form containing a file upload that can be revealed depending on
> whether that particular workflow is desired.
>
> Please see attached quickstart project that shows this failing using Wicket
> version 1.4.15 (
>
> http://apache-wicket.1842946.n4.nabble.com/file/n3221308/nestedFormsWithMultipart.zip
> nestedFormsWithMultipart.zip ).  Basically, first click on the New button
> to
> reveal the hidden form (that has the file upload).  Now hit the Cancel
> button and the form is hidden. Ok, but now if you click on New again the an
> multipart exception is thrown.
>
> This may be somewhat related to "Nested Forms and Multipart Fileupload
> Issue"
> (
> http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p1844365.html
> ),
> but a quick read of that thread suggest it is dealing with modal stuff
> (thus
> I created this post).
>
> I think this is a bug, as I don't remember this failing in the previous
> version we were using (Wicket 1.4.9) - though this is still to be
> confirmed.
>
> -----
>
> Eric is learning how to use Wicket and enjoying the experience so far...
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Multipart-issues-in-Wicket-1-4-15-tp3221308p3221308.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

Re: Multipart issues in Wicket 1.4.15

Posted by Igor Vaynberg <ig...@gmail.com>.
file a jira issue. it will get lost here.

-igor

On Tue, Jan 18, 2011 at 2:43 AM, exl <er...@uwa.edu.au> wrote:
>
> Encountering a show stopper for our project that involves being able to deal
> with a form containing a file upload that can be revealed depending on
> whether that particular workflow is desired.
>
> Please see attached quickstart project that shows this failing using Wicket
> version 1.4.15 (
> http://apache-wicket.1842946.n4.nabble.com/file/n3221308/nestedFormsWithMultipart.zip
> nestedFormsWithMultipart.zip ).  Basically, first click on the New button to
> reveal the hidden form (that has the file upload).  Now hit the Cancel
> button and the form is hidden. Ok, but now if you click on New again the an
> multipart exception is thrown.
>
> This may be somewhat related to "Nested Forms and Multipart Fileupload
> Issue"
> (http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p1844365.html),
> but a quick read of that thread suggest it is dealing with modal stuff (thus
> I created this post).
>
> I think this is a bug, as I don't remember this failing in the previous
> version we were using (Wicket 1.4.9) - though this is still to be confirmed.
>
> -----
>
> Eric is learning how to use Wicket and enjoying the experience so far...
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Multipart-issues-in-Wicket-1-4-15-tp3221308p3221308.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org