One option is to have two different event handlers for this:
1) One default event handler for the form, maybe call it form(). This will
be used when the user first goes to the action. This will be called when
the user goes to the page.
2) The second event handler could be for a search, maybe call it search().
The search button in the form will go to the search() event handler. This
will be called when a user clicks the search button or engages a filter,
depending on your design.
Another option is to have some sort of boolean flag, but that does not seem
like a good idea.
A third idea is to check inside the default event handler if the
SearchParameters (or whatever you call it) object is null. If so, then you
know the user is going to the page for the first time. The only problem
with this is if users are ever given direct links to the page with request
parameters that have search parameters in them, that may present a problem
but it would depend on the exact cases you are dealing with, you know
better than me.
Reuven
On Wed, Mar 13, 2013 at 3:29 PM, Robert Nicholson <
robert.nichol...@gmail.com> wrote:
> Does anybody know of a way to detect the first time you hit your default
> action and not any time after? I need to set some state on a bean that
> represents filter criteria on a form but I only want to do it the first
> time I visit the page.
>
> I need different functionality whenever I visit the page after visiting
> another page vs explicitly hitting the search button with no filter
> criteria defined.
>
> I need to first visit a page and default my search criteria but also
> support explicitly searching with no criteria specified.
>
> Sent from my iPad
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users