Ajax and Form#setMulitPart(true)

2009-08-22 Thread Major Péter

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.9070...@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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Ajax and Form#setMulitPart(true)

2009-08-22 Thread Major Péter
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.9070...@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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Absolute urls in forms

2009-08-22 Thread Steen Larsen
Haha, Its not me doing the proxy work. Don't know why they consider it
a problem, but they would really like absolute urls.

/Steen

2009/8/21 Igor Vaynberg igor.vaynb...@gmail.com:
 thats funny, we worked really had to make all urls relative because it
 would make it a lot easier to work with proxies... :)

 -igor

 On Fri, Aug 21, 2009 at 12:43 AM, Steen Larsensteen...@gmail.com wrote:
 Hi,

 Just a quick question. Is it somehow possible to make Wicket generate
 absolute urls in the forms action attribute. The reason I ask is
 because my Wicket application is going to be embedded in a CMS through
 a proxy, and apparently the dude writing the proxy would prefer the
 urls to be absolute.

 /Steen

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



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



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



Re: Ajax and Form#setMulitPart(true)

2009-08-22 Thread Marcin Palka

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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Absolute urls in forms

2009-08-22 Thread Erik van Oosten

I've always wondered about that

Anyways, you can make all URLs absolute by following the hints in 
https://issues.apache.org/jira/browse/WICKET-1974.


You'll need to patch Wicket as the issue is not yet solved. (I really 
should make the patch, its soo easy, just have to find time.)


Regards,
   Erik.



Igor Vaynberg wrote:

thats funny, we worked really had to make all urls relative because it
would make it a lot easier to work with proxies... :)

-igor

  


--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Ajax and Form#setMultiPart(true)

2009-08-22 Thread Major Péter

Thanks, Marcin,

but I had problems with ListView and element removing ( see: 
http://mail-archives.apache.org/mod_mbox/wicket-users/200908.mbox/%3c4a894c62.8070...@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.p...@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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Ajax and Form#setMultiPart(true)

2009-08-22 Thread Marcin Palka

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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Ajax and Form#setMultiPart(true)

2009-08-22 Thread Major Péter

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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



ajax navigation toolbars not updating when rows are added to initially empty table

2009-08-22 Thread Jason Novotny

Hi,
  
   In a nutshell, I have a table that starts off empty and rows are 
added to it dynamically. So I have a DataTable inside of a 
WebMarkupContainer where setOutputMarkupId(true) and in the ajax 
callback I do a target.addComponent(markupContainer). So far so good and 
the table does update with new table rows. However, the paging toolbar 
on the bottom never gets displayed. So if I set the rowsPerPage to 3 and 
enter a 4th item, the row basically disappears. The code knows not to 
display a 4th row, but it doesn't display the navigation toolbar either. 
If I refresh the entire page, then the complete table with navigator 
suddenly appears.  It feels as if setOutputMarkupPlaceholderTag was 
never set to true deep in the bowels of the datatable/toolbar code since 
once it starts out as invisible it never has a chance to become visible. 
Does anyone have any ideas if this is a bug or I'm just missing 
something. FYI, I'm using wicket 1.4.0 just released.


   Thanks, Jason

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



Re: ajax navigation toolbars not updating when rows are added to initially empty table

2009-08-22 Thread David Leangen


In a nutshell, I have a table that starts off empty and rows are  
added to it dynamically.


Perhaps if you take your table out of the nutshell, it would work?

I find that things don't work so well if I put them in a nutshell.

Just a thought. ;-)



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