Detect the first time you hit your default action?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Detect the first time you hit your default action?

Robert Nicholson-3
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Detect the first time you hit your default action?

Reuven Gaisin
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 <[hidden email]> 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
[hidden email]
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Detect the first time you hit your default action?

Edward W. Rouse
In reply to this post by Robert Nicholson-3
Store a session variable with the page and a counter. Then you can track
exactly how many times a user has returned to a page during the session.

> -----Original Message-----
> From: Robert Nicholson [mailto:[hidden email]]
> Sent: Wednesday, March 13, 2013 3:29 PM
> To: [hidden email]
> Subject: [Stripes-users] Detect the first time you hit your default
> action?
>
> 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
> [hidden email]
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Detect the first time you hit your default action?

Robert Nicholson-3
I'm still getting use to stripes but it appears that the best way is to simply differentiate b/w search and list.

In my case my default action is list and do I only default my search state in list and let the user state take affect in search.

On Mar 14, 2013, at 8:58 AM, Edward W. Rouse <[hidden email]> wrote:

> Store a session variable with the page and a counter. Then you can track
> exactly how many times a user has returned to a page during the session.
>
>> -----Original Message-----
>> From: Robert Nicholson [mailto:[hidden email]]
>> Sent: Wednesday, March 13, 2013 3:29 PM
>> To: [hidden email]
>> Subject: [Stripes-users] Detect the first time you hit your default
>> action?
>>
>> 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
>> [hidden email]
>> 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
> [hidden email]
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users