You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Richard Yee <ri...@gmail.com> on 2008/03/22 05:21:39 UTC

[Trinidad] Session is about to expire dialog

Hi,
I am currently using a servlet filter to handle session timeouts to redirect
the request to a session expired page. This is working okay except for if
the user clicks on the chooseDate calendar icon after the session times out.
With ENABLE_LIGHTWEIGHT_DIALOGS="false" (due to the month name problem in
IE6 (Trinidad-941)), the session expired page appears in the calendar window
instead of the main window. Once approach to handling this case as well as
providing the user a warning before the session is going to timeout is to
display a dialog to the user prior to the session timeout that says
something like, "Your session is about to timeout" with a Continue button.
After a minute or two, the dialog would automatically be cleared and an AJAX
call would be made to the server to force the session expiration. To do
this, I would have to have a JavaScript timer that would be started when the
page is loaded, reset whenever a PPR call is made, and cleared whenever the
page is unloaded. Has anyone implemented this with Trinidad? Is there a way
to get notified via a callback or hook method when a PPR request is made by
the Trinidad JavaScript API? Correctime if I'm wrong, but I don't think I
can use the Trinidad dialog framework for this because it must be
implemented for every page in the application.

Thanks,

Richard

Re: [Trinidad] Session is about to expire dialog

Posted by Richard Yee <ri...@gmail.com>.
Andrew,
Thanks. It looks like addStateChangeListener(myCallback) should do the
trick.

-Richard



On 3/24/08, Andrew Robinson <an...@gmail.com> wrote:
>
> http://myfaces.apache.org/trinidad/devguide/ppr.html
>
> TrPage.getInstance().getRequestQueue().addStateChangeListener(myCallback);
>
> -Andrew
>
> On Mon, Mar 24, 2008 at 11:39 AM, Richard Yee <ri...@gmail.com>
> wrote:
> > I do need a hook into the Trinidad PPR mechanism so that I can reset the
> > timer whenever a PPR call is made. This will effectively refresh the
> > session.
> >
> > -Richard
> >
> >
> >
> >
> >
> > On 3/24/08, Scott O'Bryan <da...@gmail.com> wrote:
> > > I see.  So it's not that you need a hook into Trinidad's ppr mechanism
> > > so much as you want to generate a ppr request yourself using
> Trinidad's
> > > apis.  Does that about sum it up?
> > >
> > > Scott
> > >
> > > Richard Yee wrote:
> > > > The client side code would involve using a JavaScript timer that is
> > > > created using the standard setTimeout(expression, timeout) call.
> This
> > > > timeout period would be slightly shorter than the timeout period
> that
> > > > is set on the server. The expression argument would call a function
> to
> > > > display the "Session is about to expire dialog". Once the dialog is
> > > > displayed, another timer is created that will clear the dialog and
> > > > cause an AJAX call that would invoke a servlet to expire the session
> > > > on the server if the user doesn't respond within a short amount of
> > > > time. If the user clicks the "Continue" dialog button, an AJAX call
> is
> > > > made to a servlet that will refresh the session.
> > > >
> > > > This is how many online banking applications handle session
> timeouts.
> > > >
> > > > -Richard
> > > >
> > > >
> > > >
> > > >
> > > > On 3/24/08, *Scott O'Bryan* <darkarena@gmail.com
> > > > <ma...@gmail.com>> wrote:
> > > >
> > > >     I guess I'm confused as to how the code on the client side would
> > know
> > > >     the session is about to expire without doing a ppr?
> > > >
> > > >     Scott
> > > >
> > > >     Richard Yee wrote:
> > > >     > Scott,
> > > >     > The poll component will not work because I don't want to
> invoke
> > > >     a PPR
> > > >     > b/c it will refresh the session. What I need is a hook into
> the
> > > >     > Trinidad JavaScript API like an "onPPR()" method that I can
> > override
> > > >     > to be notified when a PPR request is made. The purpose of the
> > dialog
> > > >     > is to tell the user if they are still in front of the screen
> that
> > > >     > their session is about to expire and give them the opportunity
> to
> > > >     > refresh the session rather than have them do something with
> the
> > > >     UI and
> > > >     > then get redirected to a page that tells them that their
> session
> > > >     timed
> > > >     > out.
> > > >     >
> > > >     > Thanks,
> > > >     >
> > > >     > -Richard
> > > >     >
> > > >     >
> > > >     >
> > > >     > On 3/24/08, *Scott O'Bryan* <darkarena@gmail.com
> > > >     <ma...@gmail.com>
> > > >     > <mailto:darkarena@gmail.com <ma...@gmail.com>>>
> wrote:
> > > >     >
> > > >     >     Will the "poll" component in Trinidad do what your asking?
> > > >     >
> > > >     >
> > > >     >     On Fri, Mar 21, 2008 at 10:21 PM, Richard Yee
> > > >     >     <richard.k.yee@gmail.com <ma...@gmail.com>
> > > >     <mailto:richard.k.yee@gmail.com <mailto:richard.k.yee@gmail.com
> >>>
> > > >     wrote:
> > > >     >
> > > >     >         Hi,
> > > >     >         I am currently using a servlet filter to handle
> session
> > > >     >         timeouts to redirect the request to a session expired
> > page.
> > > >     >         This is working okay except for if the user clicks on
> the
> > > >     >         chooseDate calendar icon after the session times out.
> With
> > > >     >         ENABLE_LIGHTWEIGHT_DIALOGS="false" (due to the month
> name
> > > >     >         problem in IE6 (Trinidad-941)), the session expired
> page
> > > >     >         appears in the calendar window instead of the main
> window.
> > > >     >         Once approach to handling this case as well as
> providing
> > the
> > > >     >         user a warning before the session is going to timeout
> is
> > to
> > > >     >         display a dialog to the user prior to the session
> > > >     timeout that
> > > >     >         says something like, "Your session is about to
> timeout"
> > > >     with a
> > > >     >         Continue button. After a minute or two, the dialog
> would
> > > >     >         automatically be cleared and an AJAX call would be
> made
> > > >     to the
> > > >     >         server to force the session expiration. To do this, I
> > would
> > > >     >         have to have a JavaScript timer that would be started
> > > >     when the
> > > >     >         page is loaded, reset whenever a PPR call is made, and
> > > >     cleared
> > > >     >         whenever the page is unloaded. Has anyone implemented
> this
> > > >     >         with Trinidad? Is there a way to get notified via a
> > callback
> > > >     >         or hook method when a PPR request is made by the
> Trinidad
> > > >     >         JavaScript API? Correctime if I'm wrong, but I don't
> think
> > I
> > > >     >         can use the Trinidad dialog framework for this because
> > > >     it must
> > > >     >         be implemented for every page in the application.
> > > >     >
> > > >     >         Thanks,
> > > >     >
> > > >     >         Richard
> > > >     >
> > > >     >
> > > >     >
> > > >
> > > >
> > >
> > >
> >
> >
>

Re: [Trinidad] Session is about to expire dialog

Posted by Andrew Robinson <an...@gmail.com>.
http://myfaces.apache.org/trinidad/devguide/ppr.html

TrPage.getInstance().getRequestQueue().addStateChangeListener(myCallback);

-Andrew

On Mon, Mar 24, 2008 at 11:39 AM, Richard Yee <ri...@gmail.com> wrote:
> I do need a hook into the Trinidad PPR mechanism so that I can reset the
> timer whenever a PPR call is made. This will effectively refresh the
> session.
>
> -Richard
>
>
>
>
>
> On 3/24/08, Scott O'Bryan <da...@gmail.com> wrote:
> > I see.  So it's not that you need a hook into Trinidad's ppr mechanism
> > so much as you want to generate a ppr request yourself using Trinidad's
> > apis.  Does that about sum it up?
> >
> > Scott
> >
> > Richard Yee wrote:
> > > The client side code would involve using a JavaScript timer that is
> > > created using the standard setTimeout(expression, timeout) call. This
> > > timeout period would be slightly shorter than the timeout period that
> > > is set on the server. The expression argument would call a function to
> > > display the "Session is about to expire dialog". Once the dialog is
> > > displayed, another timer is created that will clear the dialog and
> > > cause an AJAX call that would invoke a servlet to expire the session
> > > on the server if the user doesn't respond within a short amount of
> > > time. If the user clicks the "Continue" dialog button, an AJAX call is
> > > made to a servlet that will refresh the session.
> > >
> > > This is how many online banking applications handle session timeouts.
> > >
> > > -Richard
> > >
> > >
> > >
> > >
> > > On 3/24/08, *Scott O'Bryan* <darkarena@gmail.com
> > > <ma...@gmail.com>> wrote:
> > >
> > >     I guess I'm confused as to how the code on the client side would
> know
> > >     the session is about to expire without doing a ppr?
> > >
> > >     Scott
> > >
> > >     Richard Yee wrote:
> > >     > Scott,
> > >     > The poll component will not work because I don't want to invoke
> > >     a PPR
> > >     > b/c it will refresh the session. What I need is a hook into the
> > >     > Trinidad JavaScript API like an "onPPR()" method that I can
> override
> > >     > to be notified when a PPR request is made. The purpose of the
> dialog
> > >     > is to tell the user if they are still in front of the screen that
> > >     > their session is about to expire and give them the opportunity to
> > >     > refresh the session rather than have them do something with the
> > >     UI and
> > >     > then get redirected to a page that tells them that their session
> > >     timed
> > >     > out.
> > >     >
> > >     > Thanks,
> > >     >
> > >     > -Richard
> > >     >
> > >     >
> > >     >
> > >     > On 3/24/08, *Scott O'Bryan* <darkarena@gmail.com
> > >     <ma...@gmail.com>
> > >     > <mailto:darkarena@gmail.com <ma...@gmail.com>>> wrote:
> > >     >
> > >     >     Will the "poll" component in Trinidad do what your asking?
> > >     >
> > >     >
> > >     >     On Fri, Mar 21, 2008 at 10:21 PM, Richard Yee
> > >     >     <richard.k.yee@gmail.com <ma...@gmail.com>
> > >     <mailto:richard.k.yee@gmail.com <ma...@gmail.com>>>
> > >     wrote:
> > >     >
> > >     >         Hi,
> > >     >         I am currently using a servlet filter to handle session
> > >     >         timeouts to redirect the request to a session expired
> page.
> > >     >         This is working okay except for if the user clicks on the
> > >     >         chooseDate calendar icon after the session times out. With
> > >     >         ENABLE_LIGHTWEIGHT_DIALOGS="false" (due to the month name
> > >     >         problem in IE6 (Trinidad-941)), the session expired page
> > >     >         appears in the calendar window instead of the main window.
> > >     >         Once approach to handling this case as well as providing
> the
> > >     >         user a warning before the session is going to timeout is
> to
> > >     >         display a dialog to the user prior to the session
> > >     timeout that
> > >     >         says something like, "Your session is about to timeout"
> > >     with a
> > >     >         Continue button. After a minute or two, the dialog would
> > >     >         automatically be cleared and an AJAX call would be made
> > >     to the
> > >     >         server to force the session expiration. To do this, I
> would
> > >     >         have to have a JavaScript timer that would be started
> > >     when the
> > >     >         page is loaded, reset whenever a PPR call is made, and
> > >     cleared
> > >     >         whenever the page is unloaded. Has anyone implemented this
> > >     >         with Trinidad? Is there a way to get notified via a
> callback
> > >     >         or hook method when a PPR request is made by the Trinidad
> > >     >         JavaScript API? Correctime if I'm wrong, but I don't think
> I
> > >     >         can use the Trinidad dialog framework for this because
> > >     it must
> > >     >         be implemented for every page in the application.
> > >     >
> > >     >         Thanks,
> > >     >
> > >     >         Richard
> > >     >
> > >     >
> > >     >
> > >
> > >
> >
> >
>
>

Re: [Trinidad] Session is about to expire dialog

Posted by Richard Yee <ri...@gmail.com>.
I do need a hook into the Trinidad PPR mechanism so that I can reset the
timer whenever a PPR call is made. This will effectively refresh the
session.

-Richard



On 3/24/08, Scott O'Bryan <da...@gmail.com> wrote:
>
> I see.  So it's not that you need a hook into Trinidad's ppr mechanism
> so much as you want to generate a ppr request yourself using Trinidad's
> apis.  Does that about sum it up?
>
> Scott
>
> Richard Yee wrote:
> > The client side code would involve using a JavaScript timer that is
> > created using the standard setTimeout(expression, timeout) call. This
> > timeout period would be slightly shorter than the timeout period that
> > is set on the server. The expression argument would call a function to
> > display the "Session is about to expire dialog". Once the dialog is
> > displayed, another timer is created that will clear the dialog and
> > cause an AJAX call that would invoke a servlet to expire the session
> > on the server if the user doesn't respond within a short amount of
> > time. If the user clicks the "Continue" dialog button, an AJAX call is
> > made to a servlet that will refresh the session.
> >
> > This is how many online banking applications handle session timeouts.
> >
> > -Richard
> >
> >
> >
> >
> > On 3/24/08, *Scott O'Bryan* <darkarena@gmail.com
> > <ma...@gmail.com>> wrote:
> >
> >     I guess I'm confused as to how the code on the client side would
> know
> >     the session is about to expire without doing a ppr?
> >
> >     Scott
> >
> >     Richard Yee wrote:
> >     > Scott,
> >     > The poll component will not work because I don't want to invoke
> >     a PPR
> >     > b/c it will refresh the session. What I need is a hook into the
> >     > Trinidad JavaScript API like an "onPPR()" method that I can
> override
> >     > to be notified when a PPR request is made. The purpose of the
> dialog
> >     > is to tell the user if they are still in front of the screen that
> >     > their session is about to expire and give them the opportunity to
> >     > refresh the session rather than have them do something with the
> >     UI and
> >     > then get redirected to a page that tells them that their session
> >     timed
> >     > out.
> >     >
> >     > Thanks,
> >     >
> >     > -Richard
> >     >
> >     >
> >     >
> >     > On 3/24/08, *Scott O'Bryan* <darkarena@gmail.com
> >     <ma...@gmail.com>
> >     > <mailto:darkarena@gmail.com <ma...@gmail.com>>> wrote:
> >     >
> >     >     Will the "poll" component in Trinidad do what your asking?
> >     >
> >     >
> >     >     On Fri, Mar 21, 2008 at 10:21 PM, Richard Yee
> >     >     <richard.k.yee@gmail.com <ma...@gmail.com>
> >     <mailto:richard.k.yee@gmail.com <ma...@gmail.com>>>
> >     wrote:
> >     >
> >     >         Hi,
> >     >         I am currently using a servlet filter to handle session
> >     >         timeouts to redirect the request to a session expired
> page.
> >     >         This is working okay except for if the user clicks on the
> >     >         chooseDate calendar icon after the session times out. With
> >     >         ENABLE_LIGHTWEIGHT_DIALOGS="false" (due to the month name
> >     >         problem in IE6 (Trinidad-941)), the session expired page
> >     >         appears in the calendar window instead of the main window.
> >     >         Once approach to handling this case as well as providing
> the
> >     >         user a warning before the session is going to timeout is
> to
> >     >         display a dialog to the user prior to the session
> >     timeout that
> >     >         says something like, "Your session is about to timeout"
> >     with a
> >     >         Continue button. After a minute or two, the dialog would
> >     >         automatically be cleared and an AJAX call would be made
> >     to the
> >     >         server to force the session expiration. To do this, I
> would
> >     >         have to have a JavaScript timer that would be started
> >     when the
> >     >         page is loaded, reset whenever a PPR call is made, and
> >     cleared
> >     >         whenever the page is unloaded. Has anyone implemented this
> >     >         with Trinidad? Is there a way to get notified via a
> callback
> >     >         or hook method when a PPR request is made by the Trinidad
> >     >         JavaScript API? Correctime if I'm wrong, but I don't think
> I
> >     >         can use the Trinidad dialog framework for this because
> >     it must
> >     >         be implemented for every page in the application.
> >     >
> >     >         Thanks,
> >     >
> >     >         Richard
> >     >
> >     >
> >     >
> >
> >
>
>

Re: [Trinidad] Session is about to expire dialog

Posted by Scott O'Bryan <da...@gmail.com>.
I see.  So it's not that you need a hook into Trinidad's ppr mechanism 
so much as you want to generate a ppr request yourself using Trinidad's 
apis.  Does that about sum it up?

Scott

Richard Yee wrote:
> The client side code would involve using a JavaScript timer that is 
> created using the standard setTimeout(expression, timeout) call. This 
> timeout period would be slightly shorter than the timeout period that 
> is set on the server. The expression argument would call a function to 
> display the "Session is about to expire dialog". Once the dialog is 
> displayed, another timer is created that will clear the dialog and 
> cause an AJAX call that would invoke a servlet to expire the session 
> on the server if the user doesn't respond within a short amount of 
> time. If the user clicks the "Continue" dialog button, an AJAX call is 
> made to a servlet that will refresh the session.
>  
> This is how many online banking applications handle session timeouts.
>  
> -Richard
>  
>  
>  
>  
> On 3/24/08, *Scott O'Bryan* <darkarena@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     I guess I'm confused as to how the code on the client side would know
>     the session is about to expire without doing a ppr?
>
>     Scott
>
>     Richard Yee wrote:
>     > Scott,
>     > The poll component will not work because I don't want to invoke
>     a PPR
>     > b/c it will refresh the session. What I need is a hook into the
>     > Trinidad JavaScript API like an "onPPR()" method that I can override
>     > to be notified when a PPR request is made. The purpose of the dialog
>     > is to tell the user if they are still in front of the screen that
>     > their session is about to expire and give them the opportunity to
>     > refresh the session rather than have them do something with the
>     UI and
>     > then get redirected to a page that tells them that their session
>     timed
>     > out.
>     >
>     > Thanks,
>     >
>     > -Richard
>     >
>     >
>     >
>     > On 3/24/08, *Scott O'Bryan* <darkarena@gmail.com
>     <ma...@gmail.com>
>     > <mailto:darkarena@gmail.com <ma...@gmail.com>>> wrote:
>     >
>     >     Will the "poll" component in Trinidad do what your asking?
>     >
>     >
>     >     On Fri, Mar 21, 2008 at 10:21 PM, Richard Yee
>     >     <richard.k.yee@gmail.com <ma...@gmail.com>
>     <mailto:richard.k.yee@gmail.com <ma...@gmail.com>>>
>     wrote:
>     >
>     >         Hi,
>     >         I am currently using a servlet filter to handle session
>     >         timeouts to redirect the request to a session expired page.
>     >         This is working okay except for if the user clicks on the
>     >         chooseDate calendar icon after the session times out. With
>     >         ENABLE_LIGHTWEIGHT_DIALOGS="false" (due to the month name
>     >         problem in IE6 (Trinidad-941)), the session expired page
>     >         appears in the calendar window instead of the main window.
>     >         Once approach to handling this case as well as providing the
>     >         user a warning before the session is going to timeout is to
>     >         display a dialog to the user prior to the session
>     timeout that
>     >         says something like, "Your session is about to timeout"
>     with a
>     >         Continue button. After a minute or two, the dialog would
>     >         automatically be cleared and an AJAX call would be made
>     to the
>     >         server to force the session expiration. To do this, I would
>     >         have to have a JavaScript timer that would be started
>     when the
>     >         page is loaded, reset whenever a PPR call is made, and
>     cleared
>     >         whenever the page is unloaded. Has anyone implemented this
>     >         with Trinidad? Is there a way to get notified via a callback
>     >         or hook method when a PPR request is made by the Trinidad
>     >         JavaScript API? Correctime if I'm wrong, but I don't think I
>     >         can use the Trinidad dialog framework for this because
>     it must
>     >         be implemented for every page in the application.
>     >
>     >         Thanks,
>     >
>     >         Richard
>     >
>     >
>     >
>
>


Re: [Trinidad] Session is about to expire dialog

Posted by Richard Yee <ri...@gmail.com>.
The client side code would involve using a JavaScript timer that is created
using the standard setTimeout(expression, timeout) call. This timeout period
would be slightly shorter than the timeout period that is set on the server.
The expression argument would call a function to display the "Session is
about to expire dialog". Once the dialog is displayed, another timer is
created that will clear the dialog and cause an AJAX call that would invoke
a servlet to expire the session on the server if the user doesn't respond
within a short amount of time. If the user clicks the "Continue" dialog
button, an AJAX call is made to a servlet that will refresh the session.

This is how many online banking applications handle session timeouts.

-Richard




On 3/24/08, Scott O'Bryan <da...@gmail.com> wrote:

> I guess I'm confused as to how the code on the client side would know
> the session is about to expire without doing a ppr?
>
> Scott
>
> Richard Yee wrote:
> > Scott,
> > The poll component will not work because I don't want to invoke a PPR
> > b/c it will refresh the session. What I need is a hook into the
> > Trinidad JavaScript API like an "onPPR()" method that I can override
> > to be notified when a PPR request is made. The purpose of the dialog
> > is to tell the user if they are still in front of the screen that
> > their session is about to expire and give them the opportunity to
> > refresh the session rather than have them do something with the UI and
> > then get redirected to a page that tells them that their session timed
> > out.
> >
> > Thanks,
> >
> > -Richard
> >
> >
> >
> > On 3/24/08, *Scott O'Bryan* <darkarena@gmail.com
> > <ma...@gmail.com>> wrote:
> >
> >     Will the "poll" component in Trinidad do what your asking?
> >
> >
> >     On Fri, Mar 21, 2008 at 10:21 PM, Richard Yee
> >     <richard.k.yee@gmail.com <ma...@gmail.com>> wrote:
> >
> >         Hi,
> >         I am currently using a servlet filter to handle session
> >         timeouts to redirect the request to a session expired page.
> >         This is working okay except for if the user clicks on the
> >         chooseDate calendar icon after the session times out. With
> >         ENABLE_LIGHTWEIGHT_DIALOGS="false" (due to the month name
> >         problem in IE6 (Trinidad-941)), the session expired page
> >         appears in the calendar window instead of the main window.
> >         Once approach to handling this case as well as providing the
> >         user a warning before the session is going to timeout is to
> >         display a dialog to the user prior to the session timeout that
> >         says something like, "Your session is about to timeout" with a
> >         Continue button. After a minute or two, the dialog would
> >         automatically be cleared and an AJAX call would be made to the
> >         server to force the session expiration. To do this, I would
> >         have to have a JavaScript timer that would be started when the
> >         page is loaded, reset whenever a PPR call is made, and cleared
> >         whenever the page is unloaded. Has anyone implemented this
> >         with Trinidad? Is there a way to get notified via a callback
> >         or hook method when a PPR request is made by the Trinidad
> >         JavaScript API? Correctime if I'm wrong, but I don't think I
> >         can use the Trinidad dialog framework for this because it must
> >         be implemented for every page in the application.
> >
> >         Thanks,
> >
> >         Richard
> >
> >
> >
>
>

Re: [Trinidad] Session is about to expire dialog

Posted by Scott O'Bryan <da...@gmail.com>.
I guess I'm confused as to how the code on the client side would know 
the session is about to expire without doing a ppr?

Scott

Richard Yee wrote:
> Scott,
> The poll component will not work because I don't want to invoke a PPR 
> b/c it will refresh the session. What I need is a hook into the 
> Trinidad JavaScript API like an "onPPR()" method that I can override 
> to be notified when a PPR request is made. The purpose of the dialog 
> is to tell the user if they are still in front of the screen that 
> their session is about to expire and give them the opportunity to 
> refresh the session rather than have them do something with the UI and 
> then get redirected to a page that tells them that their session timed 
> out.
>  
> Thanks,
>  
> -Richard
>
>
>  
> On 3/24/08, *Scott O'Bryan* <darkarena@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     Will the "poll" component in Trinidad do what your asking?
>
>
>     On Fri, Mar 21, 2008 at 10:21 PM, Richard Yee
>     <richard.k.yee@gmail.com <ma...@gmail.com>> wrote:
>
>         Hi,
>         I am currently using a servlet filter to handle session
>         timeouts to redirect the request to a session expired page.
>         This is working okay except for if the user clicks on the
>         chooseDate calendar icon after the session times out. With
>         ENABLE_LIGHTWEIGHT_DIALOGS="false" (due to the month name
>         problem in IE6 (Trinidad-941)), the session expired page
>         appears in the calendar window instead of the main window.
>         Once approach to handling this case as well as providing the
>         user a warning before the session is going to timeout is to
>         display a dialog to the user prior to the session timeout that
>         says something like, "Your session is about to timeout" with a
>         Continue button. After a minute or two, the dialog would
>         automatically be cleared and an AJAX call would be made to the
>         server to force the session expiration. To do this, I would
>         have to have a JavaScript timer that would be started when the
>         page is loaded, reset whenever a PPR call is made, and cleared
>         whenever the page is unloaded. Has anyone implemented this
>         with Trinidad? Is there a way to get notified via a callback
>         or hook method when a PPR request is made by the Trinidad
>         JavaScript API? Correctime if I'm wrong, but I don't think I
>         can use the Trinidad dialog framework for this because it must
>         be implemented for every page in the application.
>
>         Thanks,
>
>         Richard
>
>
>


Re: [Trinidad] Session is about to expire dialog

Posted by Matthias Wessendorf <mw...@gmail.com>.
I think it is there since the old adf faces days. Perhaps we want to  
change that but I think that is low priority

Sent from my iPod.

Am 24.03.2008 um 20:27 schrieb Max Starets <ma...@oracle.com>:

> Hey Andrew,
>
> I did not know it was documented in devguide... Thanks for pointing  
> it out.
>
> It lives in trinidad-impl, so I assumed it was not part of public API.
> In ADF Faces, we put all public JS functions/classes in the API jar.
> I can see that all Trinidad javascript lives in the IMPL jar. Do you  
> know if
> it was intentional? I am copying Matthias too since he may comment  
> on that.
>
> Thanks,
> Max
>
> Andrew Robinson wrote:
>> Max, it is part of the public API. It is clearly documented in the
>> developer documentation:
>>
>> http://myfaces.apache.org/trinidad/devguide/ppr.html
>>
>>
>> On Mon, Mar 24, 2008 at 12:06 PM, Max Starets  
>> <ma...@oracle.com> wrote:
>>
>>> Richard,
>>>
>>> I guess you want your Javascript to be notified when a PPR request  
>>> is being
>>> sent, right?
>>> There is a way to do it, but the supporting code is not part of  
>>> the public
>>> API:
>>>
>>> TrPage.getInstance().getRequestQueue().addStateChangeListener 
>>> (instance,
>>> callback);
>>>
>>> Here "instance" is an instance of the object used to invoke the  
>>> listener
>>> (it may be null if your listener is global),
>>> "callback" is the actual listener function.
>>>
>>> A single parameter (state) will be passed into your callback:
>>> state == TrRequestQueue.STATE_BUSY would indicate that PPR request  
>>> is about
>>> to be sent
>>> state == TrRequestQueue.STATE_READY would indicate that PPR  
>>> request has
>>> just returned.
>>>
>>> As I said before, this code is not part of Trinidad public API, so  
>>> there
>>> are no guarantees that it will continue
>>> working in the future. If it is something that you think is  
>>> generally
>>> useful for developers using Trinidad, you can raise
>>> a JIRA issue for that.
>>>
>>> Regards,
>>> Max Starets
>>>
>>>
>>>
>>>
>>>
>>> Richard Yee wrote:
>>>
>>> Scott,
>>> The poll component will not work because I don't want to invoke a  
>>> PPR b/c it
>>> will refresh the session. What I need is a hook into the Trinidad  
>>> JavaScript
>>> API like an "onPPR()" method that I can override to be notified  
>>> when a PPR
>>> request is made. The purpose of the dialog is to tell the user if  
>>> they are
>>> still in front of the screen that their session is about to expire  
>>> and give
>>> them the opportunity to refresh the session rather than have them do
>>> something with the UI and then get redirected to a page that tells  
>>> them that
>>> their session timed out.
>>>
>>> Thanks,
>>>
>>> -Richard
>>>
>>>
>>>
>>> On 3/24/08, Scott O'Bryan <da...@gmail.com> wrote:
>>>
>>>> Will the "poll" component in Trinidad do what your asking?
>>>>
>>>>
>>>>
>>>> On Fri, Mar 21, 2008 at 10:21 PM, Richard Yee <richard.k.yee@gmail.com 
>>>> >
>>>>
>>> wrote:
>>>
>>>>> Hi,
>>>>> I am currently using a servlet filter to handle session timeouts  
>>>>> to
>>>>>
>>> redirect the request to a session expired page. This is working  
>>> okay except
>>> for if the user clicks on the chooseDate calendar icon after the  
>>> session
>>> times out. With ENABLE_LIGHTWEIGHT_DIALOGS="false" (due to the  
>>> month name
>>> problem in IE6 (Trinidad-941)), the session expired page appears  
>>> in the
>>> calendar window instead of the main window. Once approach to  
>>> handling this
>>> case as well as providing the user a warning before the session is  
>>> going to
>>> timeout is to display a dialog to the user prior to the session  
>>> timeout that
>>> says something like, "Your session is about to timeout" with a  
>>> Continue
>>> button. After a minute or two, the dialog would automatically be  
>>> cleared and
>>> an AJAX call would be made to the server to force the session  
>>> expiration. To
>>> do this, I would have to have a JavaScript timer that would be  
>>> started when
>>> the page is loaded, reset whenever a PPR call is made, and cleared  
>>> whenever
>>> the page is unloaded. Has anyone implemented this with Trinidad?  
>>> Is there a
>>> way to get notified via a callback or hook method when a PPR  
>>> request is made
>>> by the Trinidad JavaScript API? Correctime if I'm wrong, but I  
>>> don't think I
>>> can use the Trinidad dialog framework for this because it must be
>>> implemented for every page in the application.
>>>
>>>>> Thanks,
>>>>>
>>>>> Richard
>>>>>
>>>>>
>>>>
>>>
>>>
>

Re: [Trinidad] Session is about to expire dialog

Posted by Andrew Robinson <an...@gmail.com>.
I believe the jar doesn't matter for JavaScript. I think that anything
that doesn't start with an underscore is public and anything that
starts with an underscore is not part of the API. Could someone
clarify on this?

-Andrew

On Mon, Mar 24, 2008 at 1:27 PM, Max Starets <ma...@oracle.com> wrote:
> Hey Andrew,
>
>  I did not know it was documented in devguide... Thanks for pointing it out.
>
>  It lives in trinidad-impl, so I assumed it was not part of public API.
>  In ADF Faces, we put all public JS functions/classes in the API jar.
>  I can see that all Trinidad javascript lives in the IMPL jar. Do you know if
>  it was intentional? I am copying Matthias too since he may comment on that.
>
>  Thanks,
>  Max
>
>
>
>  Andrew Robinson wrote:
>  > Max, it is part of the public API. It is clearly documented in the
>  > developer documentation:
>  >
>  > http://myfaces.apache.org/trinidad/devguide/ppr.html
>  >
>  >
>  > On Mon, Mar 24, 2008 at 12:06 PM, Max Starets <ma...@oracle.com> wrote:
>  >
>  >>  Richard,
>  >>
>  >>  I guess you want your Javascript to be notified when a PPR request is being
>  >> sent, right?
>  >>  There is a way to do it, but the supporting code is not part of the public
>  >> API:
>  >>
>  >>  TrPage.getInstance().getRequestQueue().addStateChangeListener(instance,
>  >> callback);
>  >>
>  >>  Here "instance" is an instance of the object used to invoke the listener
>  >> (it may be null if your listener is global),
>  >>  "callback" is the actual listener function.
>  >>
>  >>  A single parameter (state) will be passed into your callback:
>  >>  state == TrRequestQueue.STATE_BUSY would indicate that PPR request is about
>  >> to be sent
>  >>  state == TrRequestQueue.STATE_READY would indicate that PPR request has
>  >> just returned.
>  >>
>  >>  As I said before, this code is not part of Trinidad public API, so there
>  >> are no guarantees that it will continue
>  >>  working in the future. If it is something that you think is generally
>  >> useful for developers using Trinidad, you can raise
>  >>  a JIRA issue for that.
>  >>
>  >>  Regards,
>  >>  Max Starets
>  >>
>  >>
>  >>
>  >>
>  >>
>  >>  Richard Yee wrote:
>  >>
>  >> Scott,
>  >> The poll component will not work because I don't want to invoke a PPR b/c it
>  >> will refresh the session. What I need is a hook into the Trinidad JavaScript
>  >> API like an "onPPR()" method that I can override to be notified when a PPR
>  >> request is made. The purpose of the dialog is to tell the user if they are
>  >> still in front of the screen that their session is about to expire and give
>  >> them the opportunity to refresh the session rather than have them do
>  >> something with the UI and then get redirected to a page that tells them that
>  >> their session timed out.
>  >>
>  >> Thanks,
>  >>
>  >> -Richard
>  >>
>  >>
>  >>
>  >> On 3/24/08, Scott O'Bryan <da...@gmail.com> wrote:
>  >>
>  >>> Will the "poll" component in Trinidad do what your asking?
>  >>>
>  >>>
>  >>>
>  >>> On Fri, Mar 21, 2008 at 10:21 PM, Richard Yee <ri...@gmail.com>
>  >>>
>  >> wrote:
>  >>
>  >>>> Hi,
>  >>>> I am currently using a servlet filter to handle session timeouts to
>  >>>>
>  >> redirect the request to a session expired page. This is working okay except
>  >> for if the user clicks on the chooseDate calendar icon after the session
>  >> times out. With ENABLE_LIGHTWEIGHT_DIALOGS="false" (due to the month name
>  >> problem in IE6 (Trinidad-941)), the session expired page appears in the
>  >> calendar window instead of the main window. Once approach to handling this
>  >> case as well as providing the user a warning before the session is going to
>  >> timeout is to display a dialog to the user prior to the session timeout that
>  >> says something like, "Your session is about to timeout" with a Continue
>  >> button. After a minute or two, the dialog would automatically be cleared and
>  >> an AJAX call would be made to the server to force the session expiration. To
>  >> do this, I would have to have a JavaScript timer that would be started when
>  >> the page is loaded, reset whenever a PPR call is made, and cleared whenever
>  >> the page is unloaded. Has anyone implemented this with Trinidad? Is there a
>  >> way to get notified via a callback or hook method when a PPR request is made
>  >> by the Trinidad JavaScript API? Correctime if I'm wrong, but I don't think I
>  >> can use the Trinidad dialog framework for this because it must be
>  >> implemented for every page in the application.
>  >>
>  >>>> Thanks,
>  >>>>
>  >>>> Richard
>  >>>>
>  >>>>
>  >>>
>  >>
>  >>
>
>

Re: [Trinidad] Session is about to expire dialog

Posted by Max Starets <ma...@oracle.com>.
Hey Andrew,

I did not know it was documented in devguide... Thanks for pointing it out.

It lives in trinidad-impl, so I assumed it was not part of public API.
In ADF Faces, we put all public JS functions/classes in the API jar.
I can see that all Trinidad javascript lives in the IMPL jar. Do you know if
it was intentional? I am copying Matthias too since he may comment on that.

Thanks,
Max

Andrew Robinson wrote:
> Max, it is part of the public API. It is clearly documented in the
> developer documentation:
>
> http://myfaces.apache.org/trinidad/devguide/ppr.html
>
>
> On Mon, Mar 24, 2008 at 12:06 PM, Max Starets <ma...@oracle.com> wrote:
>   
>>  Richard,
>>
>>  I guess you want your Javascript to be notified when a PPR request is being
>> sent, right?
>>  There is a way to do it, but the supporting code is not part of the public
>> API:
>>
>>  TrPage.getInstance().getRequestQueue().addStateChangeListener(instance,
>> callback);
>>
>>  Here "instance" is an instance of the object used to invoke the listener
>> (it may be null if your listener is global),
>>  "callback" is the actual listener function.
>>
>>  A single parameter (state) will be passed into your callback:
>>  state == TrRequestQueue.STATE_BUSY would indicate that PPR request is about
>> to be sent
>>  state == TrRequestQueue.STATE_READY would indicate that PPR request has
>> just returned.
>>
>>  As I said before, this code is not part of Trinidad public API, so there
>> are no guarantees that it will continue
>>  working in the future. If it is something that you think is generally
>> useful for developers using Trinidad, you can raise
>>  a JIRA issue for that.
>>
>>  Regards,
>>  Max Starets
>>
>>
>>
>>
>>
>>  Richard Yee wrote:
>>
>> Scott,
>> The poll component will not work because I don't want to invoke a PPR b/c it
>> will refresh the session. What I need is a hook into the Trinidad JavaScript
>> API like an "onPPR()" method that I can override to be notified when a PPR
>> request is made. The purpose of the dialog is to tell the user if they are
>> still in front of the screen that their session is about to expire and give
>> them the opportunity to refresh the session rather than have them do
>> something with the UI and then get redirected to a page that tells them that
>> their session timed out.
>>
>> Thanks,
>>
>> -Richard
>>
>>
>>
>> On 3/24/08, Scott O'Bryan <da...@gmail.com> wrote:
>>     
>>> Will the "poll" component in Trinidad do what your asking?
>>>
>>>
>>>
>>> On Fri, Mar 21, 2008 at 10:21 PM, Richard Yee <ri...@gmail.com>
>>>       
>> wrote:
>>     
>>>> Hi,
>>>> I am currently using a servlet filter to handle session timeouts to
>>>>         
>> redirect the request to a session expired page. This is working okay except
>> for if the user clicks on the chooseDate calendar icon after the session
>> times out. With ENABLE_LIGHTWEIGHT_DIALOGS="false" (due to the month name
>> problem in IE6 (Trinidad-941)), the session expired page appears in the
>> calendar window instead of the main window. Once approach to handling this
>> case as well as providing the user a warning before the session is going to
>> timeout is to display a dialog to the user prior to the session timeout that
>> says something like, "Your session is about to timeout" with a Continue
>> button. After a minute or two, the dialog would automatically be cleared and
>> an AJAX call would be made to the server to force the session expiration. To
>> do this, I would have to have a JavaScript timer that would be started when
>> the page is loaded, reset whenever a PPR call is made, and cleared whenever
>> the page is unloaded. Has anyone implemented this with Trinidad? Is there a
>> way to get notified via a callback or hook method when a PPR request is made
>> by the Trinidad JavaScript API? Correctime if I'm wrong, but I don't think I
>> can use the Trinidad dialog framework for this because it must be
>> implemented for every page in the application.
>>     
>>>> Thanks,
>>>>
>>>> Richard
>>>>
>>>>         
>>>       
>>
>>     


Re: [Trinidad] Session is about to expire dialog

Posted by Andrew Robinson <an...@gmail.com>.
Max, it is part of the public API. It is clearly documented in the
developer documentation:

http://myfaces.apache.org/trinidad/devguide/ppr.html


On Mon, Mar 24, 2008 at 12:06 PM, Max Starets <ma...@oracle.com> wrote:
>
>  Richard,
>
>  I guess you want your Javascript to be notified when a PPR request is being
> sent, right?
>  There is a way to do it, but the supporting code is not part of the public
> API:
>
>  TrPage.getInstance().getRequestQueue().addStateChangeListener(instance,
> callback);
>
>  Here "instance" is an instance of the object used to invoke the listener
> (it may be null if your listener is global),
>  "callback" is the actual listener function.
>
>  A single parameter (state) will be passed into your callback:
>  state == TrRequestQueue.STATE_BUSY would indicate that PPR request is about
> to be sent
>  state == TrRequestQueue.STATE_READY would indicate that PPR request has
> just returned.
>
>  As I said before, this code is not part of Trinidad public API, so there
> are no guarantees that it will continue
>  working in the future. If it is something that you think is generally
> useful for developers using Trinidad, you can raise
>  a JIRA issue for that.
>
>  Regards,
>  Max Starets
>
>
>
>
>
>  Richard Yee wrote:
>
> Scott,
> The poll component will not work because I don't want to invoke a PPR b/c it
> will refresh the session. What I need is a hook into the Trinidad JavaScript
> API like an "onPPR()" method that I can override to be notified when a PPR
> request is made. The purpose of the dialog is to tell the user if they are
> still in front of the screen that their session is about to expire and give
> them the opportunity to refresh the session rather than have them do
> something with the UI and then get redirected to a page that tells them that
> their session timed out.
>
> Thanks,
>
> -Richard
>
>
>
> On 3/24/08, Scott O'Bryan <da...@gmail.com> wrote:
> > Will the "poll" component in Trinidad do what your asking?
> >
> >
> >
> > On Fri, Mar 21, 2008 at 10:21 PM, Richard Yee <ri...@gmail.com>
> wrote:
> >
> > > Hi,
> > > I am currently using a servlet filter to handle session timeouts to
> redirect the request to a session expired page. This is working okay except
> for if the user clicks on the chooseDate calendar icon after the session
> times out. With ENABLE_LIGHTWEIGHT_DIALOGS="false" (due to the month name
> problem in IE6 (Trinidad-941)), the session expired page appears in the
> calendar window instead of the main window. Once approach to handling this
> case as well as providing the user a warning before the session is going to
> timeout is to display a dialog to the user prior to the session timeout that
> says something like, "Your session is about to timeout" with a Continue
> button. After a minute or two, the dialog would automatically be cleared and
> an AJAX call would be made to the server to force the session expiration. To
> do this, I would have to have a JavaScript timer that would be started when
> the page is loaded, reset whenever a PPR call is made, and cleared whenever
> the page is unloaded. Has anyone implemented this with Trinidad? Is there a
> way to get notified via a callback or hook method when a PPR request is made
> by the Trinidad JavaScript API? Correctime if I'm wrong, but I don't think I
> can use the Trinidad dialog framework for this because it must be
> implemented for every page in the application.
> > >
> > > Thanks,
> > >
> > > Richard
> > >
> >
> >
>
>
>

Re: [Trinidad] Session is about to expire dialog

Posted by Richard Yee <ri...@gmail.com>.
Scott,
The poll component will not work because I don't want to invoke a PPR b/c it
will refresh the session. What I need is a hook into the Trinidad JavaScript
API like an "onPPR()" method that I can override to be notified when a PPR
request is made. The purpose of the dialog is to tell the user if they are
still in front of the screen that their session is about to expire and give
them the opportunity to refresh the session rather than have them do
something with the UI and then get redirected to a page that tells them that
their session timed out.

Thanks,

-Richard



On 3/24/08, Scott O'Bryan <da...@gmail.com> wrote:
>
> Will the "poll" component in Trinidad do what your asking?
>
> On Fri, Mar 21, 2008 at 10:21 PM, Richard Yee <ri...@gmail.com>
> wrote:
>
> > Hi,
> > I am currently using a servlet filter to handle session timeouts to
> > redirect the request to a session expired page. This is working okay except
> > for if the user clicks on the chooseDate calendar icon after the session
> > times out. With ENABLE_LIGHTWEIGHT_DIALOGS="false" (due to the month name
> > problem in IE6 (Trinidad-941)), the session expired page appears in the
> > calendar window instead of the main window. Once approach to handling this
> > case as well as providing the user a warning before the session is going to
> > timeout is to display a dialog to the user prior to the session timeout that
> > says something like, "Your session is about to timeout" with a Continue
> > button. After a minute or two, the dialog would automatically be cleared and
> > an AJAX call would be made to the server to force the session expiration. To
> > do this, I would have to have a JavaScript timer that would be started when
> > the page is loaded, reset whenever a PPR call is made, and cleared whenever
> > the page is unloaded. Has anyone implemented this with Trinidad? Is there a
> > way to get notified via a callback or hook method when a PPR request is made
> > by the Trinidad JavaScript API? Correctime if I'm wrong, but I don't think I
> > can use the Trinidad dialog framework for this because it must be
> > implemented for every page in the application.
> >
> > Thanks,
> >
> > Richard
> >
>
>

Re: [Trinidad] Session is about to expire dialog

Posted by Scott O'Bryan <da...@gmail.com>.
Will the "poll" component in Trinidad do what your asking?

On Fri, Mar 21, 2008 at 10:21 PM, Richard Yee <ri...@gmail.com>
wrote:

> Hi,
> I am currently using a servlet filter to handle session timeouts to
> redirect the request to a session expired page. This is working okay except
> for if the user clicks on the chooseDate calendar icon after the session
> times out. With ENABLE_LIGHTWEIGHT_DIALOGS="false" (due to the month name
> problem in IE6 (Trinidad-941)), the session expired page appears in the
> calendar window instead of the main window. Once approach to handling this
> case as well as providing the user a warning before the session is going to
> timeout is to display a dialog to the user prior to the session timeout that
> says something like, "Your session is about to timeout" with a Continue
> button. After a minute or two, the dialog would automatically be cleared and
> an AJAX call would be made to the server to force the session expiration. To
> do this, I would have to have a JavaScript timer that would be started when
> the page is loaded, reset whenever a PPR call is made, and cleared whenever
> the page is unloaded. Has anyone implemented this with Trinidad? Is there a
> way to get notified via a callback or hook method when a PPR request is made
> by the Trinidad JavaScript API? Correctime if I'm wrong, but I don't think I
> can use the Trinidad dialog framework for this because it must be
> implemented for every page in the application.
>
> Thanks,
>
> Richard
>