You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Major Péter <ma...@sch.bme.hu> on 2009/08/22 13:04:18 UTC

Ajax and Form#setMulitPart(true)

Hi all,

I have spent hours with the following issue:
I tried to create an Ajax represent of ListEditor ( 
http://wicketinaction.com/2008/10/building-a-listeditor-form-component/ 
), but the add button didn't work at all, saying:

ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Could not 
find root <ajax-response> element

After I opened a Wireshark and watched the traffic, I saw that, the 
request was fine, but instead of ajax-response I getted always:
HTTP/1.1 302 Moved Temporarily

After googling some time again, I found this:
http://mail-archives.apache.org/mod_mbox/wicket-users/200810.mbox/%3C490466AB.9070401@grons.nl%3E

So I tried to remove my setResponsePage from form#onSubmit and the ajax 
worked! When I tried to replace setResponsePage with 
RestartResponseException, then the Ajax stopped working again. So the 
last solution was, that I added to the form a custom button, and in its 
onSubmit did I what I wanted to do in Form#onSubmit.

Summarize:
If you have enabled the MultiPart for a Form, you can't use 
setResponsePage or RRE in  its onSubmit.

Is this normal behavior for Form? If it is, then can't you write a 
little note/JavaDoc about this in Form#setMultiPart() ?

Thanks.

Regards,
Peter Major

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


Re: Ajax and Form#setMultiPart(true)

Posted by Major Péter <ma...@sch.bme.hu>.
Jira issue:
https://issues.apache.org/jira/browse/WICKET-2432

2009-08-23 21:20 keltezéssel, Johan Compagner írta:
> Pleae try to find out why it broke in 1.4.1 and make a case for this in jira
>
> On 23/08/2009, Major Péter<ma...@sch.bme.hu>  wrote:
>> Marcin,
>>
>> That's it, thanks!!
>> I would never had thought about downgrading to 1.4.0.
>> After changing one character in pom.xml, it works...
>>
>> Thanks again.
>>
>> Regards,
>> Peter
>>
>> 2009-08-23 15:40 keltezéssel, Marcin Palka írta:
>>>
>>> Peter,
>>>
>>> I modifed your quickstart a bit and it seems to work with the wicket
>>> 1.4.0.
>>> Unfortunately I haven't been able for make it work with the 1.4.1. I've
>>> got
>>> no idea why. It may be a bug.
>>>
>>> http://www.nabble.com/file/p25103405/quickstart-modified.zip
>>> quickstart-modified.zip
>>>
>>> cheers,
>>> Marcin

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


Re: Ajax and Form#setMultiPart(true)

Posted by Major Péter <ma...@sch.bme.hu>.
I'm not quiet sure, but I think the problem is in a js file. When 
Firefox caches them, I always get the same behavior for both versions, 
but when I'm pressing ctrl + F5, then 1.4.0 works, 1.4.1 isn't.

2009-08-23 21:20 keltezéssel, Johan Compagner írta:
> Pleae try to find out why it broke in 1.4.1 and make a case for this in jira
>
> On 23/08/2009, Major Péter<ma...@sch.bme.hu>  wrote:
>> Marcin,
>>
>> That's it, thanks!!
>> I would never had thought about downgrading to 1.4.0.
>> After changing one character in pom.xml, it works...
>>
>> Thanks again.
>>
>> Regards,
>> Peter
>>
>> 2009-08-23 15:40 keltezéssel, Marcin Palka írta:
>>>
>>> Peter,
>>>
>>> I modifed your quickstart a bit and it seems to work with the wicket
>>> 1.4.0.
>>> Unfortunately I haven't been able for make it work with the 1.4.1. I've
>>> got
>>> no idea why. It may be a bug.
>>>
>>> http://www.nabble.com/file/p25103405/quickstart-modified.zip
>>> quickstart-modified.zip
>>>
>>> cheers,
>>> Marcin

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


Re: Ajax and Form#setMultiPart(true)

Posted by Johan Compagner <jc...@gmail.com>.
Pleae try to find out why it broke in 1.4.1 and make a case for this in jira

On 23/08/2009, Major Péter <ma...@sch.bme.hu> wrote:
> Marcin,
>
> That's it, thanks!!
> I would never had thought about downgrading to 1.4.0.
> After changing one character in pom.xml, it works...
>
> Thanks again.
>
> Regards,
> Peter
>
> 2009-08-23 15:40 keltezéssel, Marcin Palka írta:
>>
>> Peter,
>>
>> I modifed your quickstart a bit and it seems to work with the wicket
>> 1.4.0.
>> Unfortunately I haven't been able for make it work with the 1.4.1. I've
>> got
>> no idea why. It may be a bug.
>>
>> http://www.nabble.com/file/p25103405/quickstart-modified.zip
>> quickstart-modified.zip
>>
>> cheers,
>> Marcin
>
> ---------------------------------------------------------------------
> 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


Re: Ajax and Form#setMultiPart(true)

Posted by Major Péter <ma...@sch.bme.hu>.
Marcin,

That's it, thanks!!
I would never had thought about downgrading to 1.4.0.
After changing one character in pom.xml, it works...

Thanks again.

Regards,
Peter

2009-08-23 15:40 keltezéssel, Marcin Palka írta:
>
> Peter,
>
> I modifed your quickstart a bit and it seems to work with the wicket 1.4.0.
> Unfortunately I haven't been able for make it work with the 1.4.1. I've got
> no idea why. It may be a bug.
>
> http://www.nabble.com/file/p25103405/quickstart-modified.zip
> quickstart-modified.zip
>
> cheers,
> Marcin

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


Re: Ajax and Form#setMultiPart(true)

Posted by Marcin Palka <ma...@gmail.com>.
Peter,

I modifed your quickstart a bit and it seems to work with the wicket 1.4.0.
Unfortunately I haven't been able for make it work with the 1.4.1. I've got
no idea why. It may be a bug.
 
http://www.nabble.com/file/p25103405/quickstart-modified.zip
quickstart-modified.zip 

cheers,
Marcin
-- 
View this message in context: http://www.nabble.com/Ajax-and-Form-setMulitPart%28true%29-tp25092790p25103405.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: Ajax and Form#setMultiPart(true)

Posted by Major Péter <ma...@sch.bme.hu>.
Marcin,

> I modified my example to allow removing items. I also modified it to use a
> RefreshingView instead of a ListView.

Thanks

> I think you should read a bit about wicket models. Any component update
> should go the following way - first update a model that is bound to a
> component and then repaint the component.

Correct, I tought that too.

> If you do not use ajax the
> component will get updated itself when you press a button of click a link.
> Do not use the setResponsePage unless you want to navigate to another page.

It's gonna be a part of an 'Edit my profile' page, and after filling out 
the form, an another page should show up, so I'm pretty sure I need that 
setResponsePage.

> If you do want to use ajax you refresh your component by adding it to the
> AjaxRequestTarget.

That's true, this part is working nicely, the components are refreshing 
via Ajax. The only problem is, that in the so called submit button, 
which will need to save datas into db/ldap, it doesn't get the input.
After some Wireshark again, I saw the following:
When I pressed Forms 'submit' button, than a following POST message was 
sent to the server (I'm just posting only the header):

POST 
/quickstart-1.0-SNAPSHOT/?wicket:interface=:0:form::IFormSubmitListener:: HTTP/1.1 

Host: localhost:8080

The POST message contains(!) the new datas, but the response is the 
following:

HTTP/1.1 302 Moved Temporarily
X-Powered-By: Servlet/2.5
Server: Sun GlassFish Enterprise Server v2.1
Location: http://localhost:8080/quickstart-1.0-SNAPSHOT/./
Content-Type: text/html; charset=iso-8859-1
Content-Length: 0
Date: Sun, 23 Aug 2009 00:42:59 GMT

I'm just can't see why is this happening.
A quickstart for the problem:
http://users.hszk.bme.hu/~mp695/quickstart.zip

//If you remove fileuploadfield, and set multipart to false, you can see 
the desirable working state

I'm using Wicket 1.4.1

Thanks,

Peter

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


Re: Ajax and Form#setMultiPart(true)

Posted by Marcin Palka <ma...@gmail.com>.
Peter,

I modified my example to allow removing items. I also modified it to use a
RefreshingView instead of a ListView. 
I think you should read a bit about wicket models. Any component update
should go the following way - first update a model that is bound to a
component and then repaint the component. If you do not use ajax the
component will get updated itself when you press a button of click a link.
Do not use the setResponsePage unless you want to navigate to another page.
If you do want to use ajax you refresh your component by adding it to the
AjaxRequestTarget.

In case of a ListView or any other repeater you just add or remove elements
to a list that is provided as a Model for a repeater and then you just make
it repaint (either ajax or non ajax way).

http://www.nabble.com/file/p25099043/ListEditor.zip ListEditor.zip  

cheers
Marcin




-- 
View this message in context: http://www.nabble.com/Ajax-and-Form-setMulitPart%28true%29-tp25092790p25099043.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: Ajax and Form#setMultiPart(true)

Posted by Major Péter <ma...@sch.bme.hu>.
Thanks, Marcin,

but I had problems with ListView and element removing ( see: 
http://mail-archives.apache.org/mod_mbox/wicket-users/200908.mbox/%3C4A894C62.8070106@sch.bme.hu%3E 
)
I tried to do this with RepeatingView, now I had tried to solve the 
problem with RefreshingView (based on this: 
http://mail-archives.apache.org/mod_mbox/wicket-users/200802.mbox/%3C15236550.post@talk.nabble.com%3E 
), but both of them aren't working, when the MultiPart flag is setted to 
true.
I'm just out of ideas now...

Regards,
Peter

2009-08-22 19:58 keltezéssel, Marcin Palka írta:
>
> Peter,
>
> Have a look into the quickstart project that is attached to my post. It's a
> simple list editor based on ListView.
>
> http://www.nabble.com/file/p25096254/ListEditor.zip ListEditor.zip . Hope it
> helps.
>
> cheers,
> Marcin

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


Re: Ajax and Form#setMulitPart(true)

Posted by Marcin Palka <ma...@gmail.com>.
Peter,

Have a look into the quickstart project that is attached to my post. It's a
simple list editor based on ListView.

http://www.nabble.com/file/p25096254/ListEditor.zip ListEditor.zip . Hope it
helps.

cheers,
Marcin
-- 
View this message in context: http://www.nabble.com/Ajax-and-Form-setMulitPart%28true%29-tp25092790p25096254.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: Ajax and Form#setMulitPart(true)

Posted by Igor Vaynberg <ig...@gmail.com>.
the only way to get multipart forms to work in an ajax manner is to do
a regular submit into a hidden iframe rather then using xmlhttprequest
because that does not support multipart encoding.

-igor

2009/8/23 Major Péter <ma...@sch.bme.hu>:
> Yes, I was using 1.4.1.
> My main problem was at first, that if I set MultiPart to true, then I can't
> have setResponsePage in Form#onSubmit. After solving this with a seperate
> Button and its onSubmit, I was getting always 302 - Moved Temporarily, when
> I tried to send my Form. (In the POST message I could see, that the datas
> from the form are there - see my previous messages for more details)
>
> I'm not quiet sure, what do you mean on "thats the only way to get multipart
> to work" - how?
>
> Thanks,
> Peter
>
> 2009-08-24 02:06 keltezéssel, Igor Vaynberg írta:
>>
>> is he using 1.4.1?
>>
>> the new ajax submit *does* a normal submit - thats the only way to get
>> multipart to work.
>>
>> -igor
>>
>> On Sun, Aug 23, 2009 at 12:22 PM, Johan Compagner<jc...@gmail.com>
>>  wrote:
>>>
>>> I guess this is because of the new feature that multi part forms work
>>> now in ajax by submitting a iframe
>>> I guess this behavior now doesnt do  a normal submit and you miss some
>>> data?
>>>
>>> On 22/08/2009, Major Péter<ma...@sch.bme.hu>  wrote:
>>>>
>>>> After solving the Ajax problem, it looks like, this is still don't want
>>>> to work...
>>>> It looks like, that because of setMultiPart(true), the new input Datas
>>>> aren't storing into models, thats why the form sends invalid content.
>>>> The code that I'm using:
>>>> http://users.hszk.bme.hu/~mp695/quickstart.zip
>>>>
>>>> //When I remove the FileUploadField and set the MultiPart to false, than
>>>> the form works as intended.
>>>>
>>>> Please help someone.
>>>> Thanks
>>>>
>>>> Peter
>>>>
>>>> 2009-08-22 13:04 keltezéssel, Major Péter írta:
>>>>>
>>>>> Hi all,
>>>>>
>>>>> I have spent hours with the following issue:
>>>>> I tried to create an Ajax represent of ListEditor (
>>>>> http://wicketinaction.com/2008/10/building-a-listeditor-form-component/
>>>>> ), but the add button didn't work at all, saying:
>>>>>
>>>>> ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Could
>>>>> not
>>>>> find root<ajax-response>  element
>>>>>
>>>>> After I opened a Wireshark and watched the traffic, I saw that, the
>>>>> request was fine, but instead of ajax-response I getted always:
>>>>> HTTP/1.1 302 Moved Temporarily
>>>>>
>>>>> After googling some time again, I found this:
>>>>>
>>>>> http://mail-archives.apache.org/mod_mbox/wicket-users/200810.mbox/%3C490466AB.9070401@grons.nl%3E
>>>>>
>>>>>
>>>>> So I tried to remove my setResponsePage from form#onSubmit and the ajax
>>>>> worked! When I tried to replace setResponsePage with
>>>>> RestartResponseException, then the Ajax stopped working again. So the
>>>>> last solution was, that I added to the form a custom button, and in its
>>>>> onSubmit did I what I wanted to do in Form#onSubmit.
>>>>>
>>>>> Summarize:
>>>>> If you have enabled the MultiPart for a Form, you can't use
>>>>> setResponsePage or RRE in its onSubmit.
>>>>>
>>>>> Is this normal behavior for Form? If it is, then can't you write a
>>>>> little note/JavaDoc about this in Form#setMultiPart() ?
>>>>>
>>>>> Thanks.
>>>>>
>>>>> Regards,
>>>>> Peter Major
>
> ---------------------------------------------------------------------
> 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


Re: Ajax and Form#setMulitPart(true)

Posted by Major Péter <ma...@sch.bme.hu>.
Yes, I was using 1.4.1.
My main problem was at first, that if I set MultiPart to true, then I 
can't have setResponsePage in Form#onSubmit. After solving this with a 
seperate Button and its onSubmit, I was getting always 302 - Moved 
Temporarily, when I tried to send my Form. (In the POST message I could 
see, that the datas from the form are there - see my previous messages 
for more details)

I'm not quiet sure, what do you mean on "thats the only way to get 
multipart to work" - how?

Thanks,
Peter

2009-08-24 02:06 keltezéssel, Igor Vaynberg írta:
> is he using 1.4.1?
>
> the new ajax submit *does* a normal submit - thats the only way to get
> multipart to work.
>
> -igor
>
> On Sun, Aug 23, 2009 at 12:22 PM, Johan Compagner<jc...@gmail.com>  wrote:
>> I guess this is because of the new feature that multi part forms work
>> now in ajax by submitting a iframe
>> I guess this behavior now doesnt do  a normal submit and you miss some data?
>>
>> On 22/08/2009, Major Péter<ma...@sch.bme.hu>  wrote:
>>> After solving the Ajax problem, it looks like, this is still don't want
>>> to work...
>>> It looks like, that because of setMultiPart(true), the new input Datas
>>> aren't storing into models, thats why the form sends invalid content.
>>> The code that I'm using:
>>> http://users.hszk.bme.hu/~mp695/quickstart.zip
>>>
>>> //When I remove the FileUploadField and set the MultiPart to false, than
>>> the form works as intended.
>>>
>>> Please help someone.
>>> Thanks
>>>
>>> Peter
>>>
>>> 2009-08-22 13:04 keltezéssel, Major Péter írta:
>>>> Hi all,
>>>>
>>>> I have spent hours with the following issue:
>>>> I tried to create an Ajax represent of ListEditor (
>>>> http://wicketinaction.com/2008/10/building-a-listeditor-form-component/
>>>> ), but the add button didn't work at all, saying:
>>>>
>>>> ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Could not
>>>> find root<ajax-response>  element
>>>>
>>>> After I opened a Wireshark and watched the traffic, I saw that, the
>>>> request was fine, but instead of ajax-response I getted always:
>>>> HTTP/1.1 302 Moved Temporarily
>>>>
>>>> After googling some time again, I found this:
>>>> http://mail-archives.apache.org/mod_mbox/wicket-users/200810.mbox/%3C490466AB.9070401@grons.nl%3E
>>>>
>>>>
>>>> So I tried to remove my setResponsePage from form#onSubmit and the ajax
>>>> worked! When I tried to replace setResponsePage with
>>>> RestartResponseException, then the Ajax stopped working again. So the
>>>> last solution was, that I added to the form a custom button, and in its
>>>> onSubmit did I what I wanted to do in Form#onSubmit.
>>>>
>>>> Summarize:
>>>> If you have enabled the MultiPart for a Form, you can't use
>>>> setResponsePage or RRE in its onSubmit.
>>>>
>>>> Is this normal behavior for Form? If it is, then can't you write a
>>>> little note/JavaDoc about this in Form#setMultiPart() ?
>>>>
>>>> Thanks.
>>>>
>>>> Regards,
>>>> Peter Major

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


Re: Ajax and Form#setMulitPart(true)

Posted by Igor Vaynberg <ig...@gmail.com>.
is he using 1.4.1?

the new ajax submit *does* a normal submit - thats the only way to get
multipart to work.

-igor

On Sun, Aug 23, 2009 at 12:22 PM, Johan Compagner<jc...@gmail.com> wrote:
> I guess this is because of the new feature that multi part forms work
> now in ajax by submitting a iframe
> I guess this behavior now doesnt do  a normal submit and you miss some data?
>
> On 22/08/2009, Major Péter <ma...@sch.bme.hu> wrote:
>> After solving the Ajax problem, it looks like, this is still don't want
>> to work...
>> It looks like, that because of setMultiPart(true), the new input Datas
>> aren't storing into models, thats why the form sends invalid content.
>> The code that I'm using:
>> http://users.hszk.bme.hu/~mp695/quickstart.zip
>>
>> //When I remove the FileUploadField and set the MultiPart to false, than
>> the form works as intended.
>>
>> Please help someone.
>> Thanks
>>
>> Peter
>>
>> 2009-08-22 13:04 keltezéssel, Major Péter írta:
>>> Hi all,
>>>
>>> I have spent hours with the following issue:
>>> I tried to create an Ajax represent of ListEditor (
>>> http://wicketinaction.com/2008/10/building-a-listeditor-form-component/
>>> ), but the add button didn't work at all, saying:
>>>
>>> ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Could not
>>> find root <ajax-response> element
>>>
>>> After I opened a Wireshark and watched the traffic, I saw that, the
>>> request was fine, but instead of ajax-response I getted always:
>>> HTTP/1.1 302 Moved Temporarily
>>>
>>> After googling some time again, I found this:
>>> http://mail-archives.apache.org/mod_mbox/wicket-users/200810.mbox/%3C490466AB.9070401@grons.nl%3E
>>>
>>>
>>> So I tried to remove my setResponsePage from form#onSubmit and the ajax
>>> worked! When I tried to replace setResponsePage with
>>> RestartResponseException, then the Ajax stopped working again. So the
>>> last solution was, that I added to the form a custom button, and in its
>>> onSubmit did I what I wanted to do in Form#onSubmit.
>>>
>>> Summarize:
>>> If you have enabled the MultiPart for a Form, you can't use
>>> setResponsePage or RRE in its onSubmit.
>>>
>>> Is this normal behavior for Form? If it is, then can't you write a
>>> little note/JavaDoc about this in Form#setMultiPart() ?
>>>
>>> Thanks.
>>>
>>> Regards,
>>> Peter Major
>>
>> ---------------------------------------------------------------------
>> 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
>
>

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


Re: Ajax and Form#setMulitPart(true)

Posted by Johan Compagner <jc...@gmail.com>.
I guess this is because of the new feature that multi part forms work
now in ajax by submitting a iframe
I guess this behavior now doesnt do  a normal submit and you miss some data?

On 22/08/2009, Major Péter <ma...@sch.bme.hu> wrote:
> After solving the Ajax problem, it looks like, this is still don't want
> to work...
> It looks like, that because of setMultiPart(true), the new input Datas
> aren't storing into models, thats why the form sends invalid content.
> The code that I'm using:
> http://users.hszk.bme.hu/~mp695/quickstart.zip
>
> //When I remove the FileUploadField and set the MultiPart to false, than
> the form works as intended.
>
> Please help someone.
> Thanks
>
> Peter
>
> 2009-08-22 13:04 keltezéssel, Major Péter írta:
>> Hi all,
>>
>> I have spent hours with the following issue:
>> I tried to create an Ajax represent of ListEditor (
>> http://wicketinaction.com/2008/10/building-a-listeditor-form-component/
>> ), but the add button didn't work at all, saying:
>>
>> ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Could not
>> find root <ajax-response> element
>>
>> After I opened a Wireshark and watched the traffic, I saw that, the
>> request was fine, but instead of ajax-response I getted always:
>> HTTP/1.1 302 Moved Temporarily
>>
>> After googling some time again, I found this:
>> http://mail-archives.apache.org/mod_mbox/wicket-users/200810.mbox/%3C490466AB.9070401@grons.nl%3E
>>
>>
>> So I tried to remove my setResponsePage from form#onSubmit and the ajax
>> worked! When I tried to replace setResponsePage with
>> RestartResponseException, then the Ajax stopped working again. So the
>> last solution was, that I added to the form a custom button, and in its
>> onSubmit did I what I wanted to do in Form#onSubmit.
>>
>> Summarize:
>> If you have enabled the MultiPart for a Form, you can't use
>> setResponsePage or RRE in its onSubmit.
>>
>> Is this normal behavior for Form? If it is, then can't you write a
>> little note/JavaDoc about this in Form#setMultiPart() ?
>>
>> Thanks.
>>
>> Regards,
>> Peter Major
>
> ---------------------------------------------------------------------
> 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


Re: Ajax and Form#setMulitPart(true)

Posted by Major Péter <ma...@sch.bme.hu>.
After solving the Ajax problem, it looks like, this is still don't want 
to work...
It looks like, that because of setMultiPart(true), the new input Datas 
aren't storing into models, thats why the form sends invalid content.
The code that I'm using:
http://users.hszk.bme.hu/~mp695/quickstart.zip

//When I remove the FileUploadField and set the MultiPart to false, than 
the form works as intended.

Please help someone.
Thanks

Peter

2009-08-22 13:04 keltezéssel, Major Péter írta:
> Hi all,
>
> I have spent hours with the following issue:
> I tried to create an Ajax represent of ListEditor (
> http://wicketinaction.com/2008/10/building-a-listeditor-form-component/
> ), but the add button didn't work at all, saying:
>
> ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Could not
> find root <ajax-response> element
>
> After I opened a Wireshark and watched the traffic, I saw that, the
> request was fine, but instead of ajax-response I getted always:
> HTTP/1.1 302 Moved Temporarily
>
> After googling some time again, I found this:
> http://mail-archives.apache.org/mod_mbox/wicket-users/200810.mbox/%3C490466AB.9070401@grons.nl%3E
>
>
> So I tried to remove my setResponsePage from form#onSubmit and the ajax
> worked! When I tried to replace setResponsePage with
> RestartResponseException, then the Ajax stopped working again. So the
> last solution was, that I added to the form a custom button, and in its
> onSubmit did I what I wanted to do in Form#onSubmit.
>
> Summarize:
> If you have enabled the MultiPart for a Form, you can't use
> setResponsePage or RRE in its onSubmit.
>
> Is this normal behavior for Form? If it is, then can't you write a
> little note/JavaDoc about this in Form#setMultiPart() ?
>
> Thanks.
>
> Regards,
> Peter Major

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