You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Vinayak Borkar <vb...@yahoo.com> on 2008/11/17 08:46:58 UTC

Simple GET based stateless form

Hi,

I am trying to create a simple GET based stateless form to implement 
search. My code is broken up into two parts
1. A SearchPanel component that renders the form containing the text field
2. A SearchPage that renders the search results.

The search page also has the SearchPanel component embedded in it so it 
would show a text field for the user to search again.

The SearchPage page is mounted using the mountBookmarkablePage() call, 
so the URL for the search page is great the first time someone does a 
search.

However, if a search is performed a second time from the form on the 
SearchPage, the URL for the new serach page has a bunch of extra wicket 
specific attributes.

How do I make the URL seen in the second search as clean as the first?
I am using wicket 1.4-m3

Thanks,
Vinayak

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


Re: AW: Simple GET based stateless form

Posted by FakeBoy <da...@gmail.com>.
Hi,
I have also some problem with stateless form in wicket 1.4-m3. I still don't
know where is the problem.
My prob is described in
http://www.nabble.com/StatelessForm-in-Bookmarkable-Page-problem-to19430608.html#a19430608

Dave



Vinayak Borkar wrote:
> 
> Stefan,
> 
> What I see on your site is exactly the behaviour I wish to have. 
> However, using the code you pasted, still gives me this as the end of my 
> URL, the second time.
> 
> searchForm1_hf_0=&..%2F..%2F..%2Fsearch%2Fwicket%3Ainterface%2F%3A0%3Asearch-bar%3AsearchForm%3A%3AIFormSubmitListener%3A%3A%2F=&query=jboss&%3Asubmit=Submit+Query
> 
> I wonder what I am doing wrong.
> 
> Thanks,
> Vinayak
> 
> Stefan Lindner wrote:
>> In the onSubmit method of your form place something like
>> 
>> 
>> 	PageParameters p = new PageParameters();
>> 	// add your search parameters here
>> 	getRequestCycle().setRequestTarget(new
>> RedirectRequestTarget(urlFor(MySearchResults.class, p).toString()));
>> 
>> Try out http://www.ai-online.info/abstracts/RefresherCourse, search for
>> something and see the url to decide if you are looking for my solution.
>> Thanks to Igor for the initial hint.
>> 
>> -----Ursprüngliche Nachricht-----
>> Von: Vinayak Borkar [mailto:vborky@yahoo.com] 
>> Gesendet: Montag, 17. November 2008 08:47
>> An: users@wicket.apache.org
>> Betreff: Simple GET based stateless form
>> 
>> Hi,
>> 
>> I am trying to create a simple GET based stateless form to implement 
>> search. My code is broken up into two parts
>> 1. A SearchPanel component that renders the form containing the text
>> field
>> 2. A SearchPage that renders the search results.
>> 
>> The search page also has the SearchPanel component embedded in it so it 
>> would show a text field for the user to search again.
>> 
>> The SearchPage page is mounted using the mountBookmarkablePage() call, 
>> so the URL for the search page is great the first time someone does a 
>> search.
>> 
>> However, if a search is performed a second time from the form on the 
>> SearchPage, the URL for the new serach page has a bunch of extra wicket 
>> specific attributes.
>> 
>> How do I make the URL seen in the second search as clean as the first?
>> I am using wicket 1.4-m3
>> 
>> Thanks,
>> Vinayak
>> 
>> ---------------------------------------------------------------------
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Simple-GET-based-stateless-form-tp20535056p20536810.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: AW: Simple GET based stateless form

Posted by Vinayak Borkar <vb...@yahoo.com>.
Stefan,

What I see on your site is exactly the behaviour I wish to have. 
However, using the code you pasted, still gives me this as the end of my 
URL, the second time.

searchForm1_hf_0=&..%2F..%2F..%2Fsearch%2Fwicket%3Ainterface%2F%3A0%3Asearch-bar%3AsearchForm%3A%3AIFormSubmitListener%3A%3A%2F=&query=jboss&%3Asubmit=Submit+Query

I wonder what I am doing wrong.

Thanks,
Vinayak

Stefan Lindner wrote:
> In the onSubmit method of your form place something like
> 
> 
> 	PageParameters p = new PageParameters();
> 	// add your search parameters here
> 	getRequestCycle().setRequestTarget(new RedirectRequestTarget(urlFor(MySearchResults.class, p).toString()));
> 
> Try out http://www.ai-online.info/abstracts/RefresherCourse, search for something and see the url to decide if you are looking for my solution. Thanks to Igor for the initial hint.
> 
> -----Ursprüngliche Nachricht-----
> Von: Vinayak Borkar [mailto:vborky@yahoo.com] 
> Gesendet: Montag, 17. November 2008 08:47
> An: users@wicket.apache.org
> Betreff: Simple GET based stateless form
> 
> Hi,
> 
> I am trying to create a simple GET based stateless form to implement 
> search. My code is broken up into two parts
> 1. A SearchPanel component that renders the form containing the text field
> 2. A SearchPage that renders the search results.
> 
> The search page also has the SearchPanel component embedded in it so it 
> would show a text field for the user to search again.
> 
> The SearchPage page is mounted using the mountBookmarkablePage() call, 
> so the URL for the search page is great the first time someone does a 
> search.
> 
> However, if a search is performed a second time from the form on the 
> SearchPage, the URL for the new serach page has a bunch of extra wicket 
> specific attributes.
> 
> How do I make the URL seen in the second search as clean as the first?
> I am using wicket 1.4-m3
> 
> Thanks,
> Vinayak
> 
> ---------------------------------------------------------------------
> 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


AW: Simple GET based stateless form

Posted by Stefan Lindner <li...@visionet.de>.
In the onSubmit method of your form place something like


	PageParameters p = new PageParameters();
	// add your search parameters here
	getRequestCycle().setRequestTarget(new RedirectRequestTarget(urlFor(MySearchResults.class, p).toString()));

Try out http://www.ai-online.info/abstracts/RefresherCourse, search for something and see the url to decide if you are looking for my solution. Thanks to Igor for the initial hint.

-----Ursprüngliche Nachricht-----
Von: Vinayak Borkar [mailto:vborky@yahoo.com] 
Gesendet: Montag, 17. November 2008 08:47
An: users@wicket.apache.org
Betreff: Simple GET based stateless form

Hi,

I am trying to create a simple GET based stateless form to implement 
search. My code is broken up into two parts
1. A SearchPanel component that renders the form containing the text field
2. A SearchPage that renders the search results.

The search page also has the SearchPanel component embedded in it so it 
would show a text field for the user to search again.

The SearchPage page is mounted using the mountBookmarkablePage() call, 
so the URL for the search page is great the first time someone does a 
search.

However, if a search is performed a second time from the form on the 
SearchPage, the URL for the new serach page has a bunch of extra wicket 
specific attributes.

How do I make the URL seen in the second search as clean as the first?
I am using wicket 1.4-m3

Thanks,
Vinayak

---------------------------------------------------------------------
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: Simple GET based stateless form

Posted by Johan Compagner <jc...@gmail.com>.
dont use a wicket form
But only have the form inside your html not as a component
And configure that form to just do a get to the url it is on
Then url must be mounted/bookmarked

The page must then have a PageParameters constructor where you read your
parameters from

johan


On Mon, Nov 17, 2008 at 8:46 AM, Vinayak Borkar <vb...@yahoo.com> wrote:

> Hi,
>
> I am trying to create a simple GET based stateless form to implement
> search. My code is broken up into two parts
> 1. A SearchPanel component that renders the form containing the text field
> 2. A SearchPage that renders the search results.
>
> The search page also has the SearchPanel component embedded in it so it
> would show a text field for the user to search again.
>
> The SearchPage page is mounted using the mountBookmarkablePage() call, so
> the URL for the search page is great the first time someone does a search.
>
> However, if a search is performed a second time from the form on the
> SearchPage, the URL for the new serach page has a bunch of extra wicket
> specific attributes.
>
> How do I make the URL seen in the second search as clean as the first?
> I am using wicket 1.4-m3
>
> Thanks,
> Vinayak
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>