myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Robinson" <>
Subject Re: [Trinidad] Session is about to expire dialog
Date Mon, 24 Mar 2008 19:12:54 GMT
Max, it is part of the public API. It is clearly documented in the
developer documentation:

On Mon, Mar 24, 2008 at 12:06 PM, Max Starets <> 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 <> wrote:
> > Will the "poll" component in Trinidad do what your asking?
> >
> >
> >
> > On Fri, Mar 21, 2008 at 10:21 PM, Richard Yee <>
> 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
> > >
> >
> >

View raw message