You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Dan Kaplan <dk...@citizenhawk.com> on 2008/02/27 00:40:40 UTC
AjaxFormValidatingBehavior on a form with a fileuploadfield crashes
Hello,
If I use: AjaxFormValidatingBehavior.addToAllFormComponents(form, "onblur");
On a form that has a fileuploadfield, it throws an exception when I blur
another field. Is there a work around/solution to this (for now, I'd be
happy to only validate the one field I want)? Here is the stack trace:
java.lang.IllegalStateException: ServletRequest does not contain multipart
content
at
org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(Mu
ltipartServletWebRequest.java:90)
at
org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest$M
ultipartRequest.<init>(UploadWebRequest.java:97)
at
org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest.n
ewMultipartWebRequest(UploadWebRequest.java:74)
at
org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1414)
at
org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:740)
at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBeh
avior.java:127)
at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:161)
at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefault
AjaxBehavior.java:288)
at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.pr
ocessEvents(BehaviorRequestTarget.java:100)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Abstra
ctRequestCycleProcessor.java:90)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:116
6)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: AjaxFormValidatingBehavior on a form with a fileuploadfield
crashes
Posted by Michael Sparer <mi...@gmx.at>.
there are however workarounds for this problem, didn't try it myself but
here's a howto using a hidden iframe which might work:
http://www.dooriented.com/blog/2008/04/23/wicket-ajax-like-file-upload-on-a-modal-window/
Martijn Dashorst wrote:
>
> This is not something we can decide. It is a limitation of Ajax, HTML,
> Browsers.
>
> Martijn
>
> On 4/29/08, nanotech <ra...@gmail.com> wrote:
>>
>> Hi,
>>
>> Will there be support in future for Ajax + multipart forms?
>>
>> Thanks,
>> RG
>>
>>
>>
>> igor.vaynberg wrote:
>> >
>> > it is a known limitation...you cannot mix ajax and multipart forms..
>> >
>> > -igor
>> >
>> >
>> > On Tue, Feb 26, 2008 at 3:40 PM, Dan Kaplan <dk...@citizenhawk.com>
>> > wrote:
>> >> Hello,
>> >>
>> >> If I use: AjaxFormValidatingBehavior.addToAllFormComponents(form,
>> >> "onblur");
>> >> On a form that has a fileuploadfield, it throws an exception when I
>> blur
>> >> another field. Is there a work around/solution to this (for now,
>> I'd be
>> >> happy to only validate the one field I want)? Here is the stack
>> trace:
>> >>
>> >> java.lang.IllegalStateException: ServletRequest does not contain
>> >> multipart
>> >> content
>> >> at
>> >>
>> >>
>> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(Mu
>> >> ltipartServletWebRequest.java:90)
>> >> at
>> >>
>> >>
>> org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest$M
>> >> ultipartRequest.<init>(UploadWebRequest.java:97)
>> >> at
>> >>
>> >>
>> org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest.n
>> >> ewMultipartWebRequest(UploadWebRequest.java:74)
>> >> at
>> >>
>> org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1414)
>> >> at
>> >>
>> org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:740)
>> >> at
>> >>
>> >>
>> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBeh
>> >> avior.java:127)
>> >> at
>> >>
>> >>
>> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:161)
>> >> at
>> >>
>> >>
>> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefault
>> >> AjaxBehavior.java:288)
>> >> at
>> >>
>> >>
>> org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.pr
>> >> ocessEvents(BehaviorRequestTarget.java:100)
>> >> at
>> >>
>> >>
>> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Abstra
>> >> ctRequestCycleProcessor.java:90)
>> >> at
>> >>
>> >>
>> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:116
>> >> 6)
>> >> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
>> >> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
>> >> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>> >> at
>> >>
>> >>
>> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
>> >> at
>> >>
>> >>
>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
>> >>
>> >>
>> >>
>> >>
>> ---------------------------------------------------------------------
>> >> 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
>> >
>> >
>> >
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/AjaxFormValidatingBehavior-on-a-form-with-a-fileuploadfield-crashes-tp15702794p16963149.html
>> Sent from the Wicket - User 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
>>
>>
>
>
> --
> Buy Wicket in Action: http://manning.com/dashorst
> Apache Wicket 1.3.3 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
-----
Michael Sparer
http://talk-on-tech.blogspot.com
--
View this message in context: http://www.nabble.com/AjaxFormValidatingBehavior-on-a-form-with-a-fileuploadfield-crashes-tp15702794p16966578.html
Sent from the Wicket - User 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: AjaxFormValidatingBehavior on a form with a fileuploadfield crashes
Posted by Martijn Dashorst <ma...@gmail.com>.
This is not something we can decide. It is a limitation of Ajax, HTML, Browsers.
Martijn
On 4/29/08, nanotech <ra...@gmail.com> wrote:
>
> Hi,
>
> Will there be support in future for Ajax + multipart forms?
>
> Thanks,
> RG
>
>
>
> igor.vaynberg wrote:
> >
> > it is a known limitation...you cannot mix ajax and multipart forms..
> >
> > -igor
> >
> >
> > On Tue, Feb 26, 2008 at 3:40 PM, Dan Kaplan <dk...@citizenhawk.com>
> > wrote:
> >> Hello,
> >>
> >> If I use: AjaxFormValidatingBehavior.addToAllFormComponents(form,
> >> "onblur");
> >> On a form that has a fileuploadfield, it throws an exception when I blur
> >> another field. Is there a work around/solution to this (for now, I'd be
> >> happy to only validate the one field I want)? Here is the stack trace:
> >>
> >> java.lang.IllegalStateException: ServletRequest does not contain
> >> multipart
> >> content
> >> at
> >>
> >> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(Mu
> >> ltipartServletWebRequest.java:90)
> >> at
> >>
> >> org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest$M
> >> ultipartRequest.<init>(UploadWebRequest.java:97)
> >> at
> >>
> >> org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest.n
> >> ewMultipartWebRequest(UploadWebRequest.java:74)
> >> at
> >> org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1414)
> >> at
> >> org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:740)
> >> at
> >>
> >> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBeh
> >> avior.java:127)
> >> at
> >>
> >> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:161)
> >> at
> >>
> >> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefault
> >> AjaxBehavior.java:288)
> >> at
> >>
> >> org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.pr
> >> ocessEvents(BehaviorRequestTarget.java:100)
> >> at
> >>
> >> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Abstra
> >> ctRequestCycleProcessor.java:90)
> >> at
> >>
> >> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:116
> >> 6)
> >> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
> >> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
> >> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
> >> at
> >>
> >> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
> >> at
> >>
> >> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
> >
>
>
> --
> View this message in context: http://www.nabble.com/AjaxFormValidatingBehavior-on-a-form-with-a-fileuploadfield-crashes-tp15702794p16963149.html
> Sent from the Wicket - User 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
>
>
--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: AjaxFormValidatingBehavior on a form with a fileuploadfield
crashes
Posted by nanotech <ra...@gmail.com>.
Hi,
Will there be support in future for Ajax + multipart forms?
Thanks,
RG
igor.vaynberg wrote:
>
> it is a known limitation...you cannot mix ajax and multipart forms..
>
> -igor
>
>
> On Tue, Feb 26, 2008 at 3:40 PM, Dan Kaplan <dk...@citizenhawk.com>
> wrote:
>> Hello,
>>
>> If I use: AjaxFormValidatingBehavior.addToAllFormComponents(form,
>> "onblur");
>> On a form that has a fileuploadfield, it throws an exception when I blur
>> another field. Is there a work around/solution to this (for now, I'd be
>> happy to only validate the one field I want)? Here is the stack trace:
>>
>> java.lang.IllegalStateException: ServletRequest does not contain
>> multipart
>> content
>> at
>>
>> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(Mu
>> ltipartServletWebRequest.java:90)
>> at
>>
>> org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest$M
>> ultipartRequest.<init>(UploadWebRequest.java:97)
>> at
>>
>> org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest.n
>> ewMultipartWebRequest(UploadWebRequest.java:74)
>> at
>> org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1414)
>> at
>> org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:740)
>> at
>>
>> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBeh
>> avior.java:127)
>> at
>>
>> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:161)
>> at
>>
>> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefault
>> AjaxBehavior.java:288)
>> at
>>
>> org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.pr
>> ocessEvents(BehaviorRequestTarget.java:100)
>> at
>>
>> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Abstra
>> ctRequestCycleProcessor.java:90)
>> at
>>
>> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:116
>> 6)
>> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
>> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
>> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>> at
>>
>> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
>> at
>>
>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
--
View this message in context: http://www.nabble.com/AjaxFormValidatingBehavior-on-a-form-with-a-fileuploadfield-crashes-tp15702794p16963149.html
Sent from the Wicket - User 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: AjaxFormValidatingBehavior on a form with a fileuploadfield crashes
Posted by Igor Vaynberg <ig...@gmail.com>.
it is a known limitation...you cannot mix ajax and multipart forms..
-igor
On Tue, Feb 26, 2008 at 3:40 PM, Dan Kaplan <dk...@citizenhawk.com> wrote:
> Hello,
>
> If I use: AjaxFormValidatingBehavior.addToAllFormComponents(form, "onblur");
> On a form that has a fileuploadfield, it throws an exception when I blur
> another field. Is there a work around/solution to this (for now, I'd be
> happy to only validate the one field I want)? Here is the stack trace:
>
> java.lang.IllegalStateException: ServletRequest does not contain multipart
> content
> at
> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(Mu
> ltipartServletWebRequest.java:90)
> at
> org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest$M
> ultipartRequest.<init>(UploadWebRequest.java:97)
> at
> org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest.n
> ewMultipartWebRequest(UploadWebRequest.java:74)
> at
> org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1414)
> at
> org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:740)
> at
> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBeh
> avior.java:127)
> at
> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:161)
> at
> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefault
> AjaxBehavior.java:288)
> at
> org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.pr
> ocessEvents(BehaviorRequestTarget.java:100)
> at
> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Abstra
> ctRequestCycleProcessor.java:90)
> at
> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:116
> 6)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
> at
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
> at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
>
>
>
> ---------------------------------------------------------------------
> 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