You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Marcel Barbosa Pinto <ma...@gmail.com> on 2017/03/07 13:53:27 UTC

Stateless search page use-case

Hi guys,

I have a stateless search page, when the user first enters the page, all
results must be returned.
Then the user can submit a filter form and then the filtered result must be
shown.

In the page's onInitialize I have a search() method which calls search()
method.

I have a form which has a CompoundPropertyModel attached with the page
model.
In onSubmit method, seach() is invoked to perform the search with the
filtered values.

The problem is, since the page is stateless the onInitialize is called and
then the onSubmit method is called when I post the form.

So I am searching twice. How would be the correct approach to this case?

I was thinking in just check if the request method is a Post and ignore the
onInitialize call...

Thanks in advance.

-- 

Marcel

Re: Stateless search page use-case

Posted by Marcel Barbosa Pinto <ma...@gmail.com>.
Hi Sven, thank you. This worked.

On Tue, Mar 7, 2017 at 11:16 AM, Sven Meier <sv...@meiers.net> wrote:

> Hi,
>
> move your search from #onInitialize() to #onConfigure() - there you can
> take
> the filters into consideration.
> #search() can just accept (and check) the new filters, but don't let it do
> the any actual search.
>
> Hope this helps
> Sven
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Stateless-search-page-use-case-tp4677258p4677259.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
>
>


-- 

Marcel Barbosa Pinto
55 11 98255 8288

Re: Stateless search page use-case

Posted by Sven Meier <sv...@meiers.net>.
Hi,

move your search from #onInitialize() to #onConfigure() - there you can take
the filters into consideration.
#search() can just accept (and check) the new filters, but don't let it do
the any actual search.

Hope this helps
Sven

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Stateless-search-page-use-case-tp4677258p4677259.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