You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Bertrand, Shawn R" <sh...@tycoelectronics.com> on 2008/04/30 13:52:37 UTC

[Trinidad] TrPollManager and self._pollManager

I've noticed the following in the client side window code (in Window.js,
openWindow method):

 

    // If there are any poll commands registered, they should be
deactivated when the

    //  modal window gets launched. They need to be reactivated upon
closing the

    //  modal dependent using _pollWhenModalDependentCloses().

    // Cleaner alternative to _pollWhenModalDependentCloses() could have
been to use a

    //  registered callback like _checkUnload(), _onModalFocus(),
_onModalLoseCapture().

    //  But none of these were reliable for either of...

    //   1. One of them is to workaround IE grabbing focus on parent

    //       while dialog launch in progress.

    //   2. Does not get called when dialog is dismissed using the close

    //       button on the window, particularly for case of dialogs

    //       launched using openWindow().

    if (isModal && self._pollManager)

    {

      _pollManager.deactivateAll();

      _pollWhenModalDependentCloses();

    }

 

I read this to say while a dialog is open, any polling going on in the
current document will be disabled until the dialog is closed.  We have a
poll tag on the main page of our application which I thought would
temporarily halt the JS setInterval until it was closed, but the polling
continues and the dialogs close with errors ("ADFDialogReturn is
undefined") if the session times out.  I would think ADFDialogReturn
would still be accessible, as it is a global JS variable defined on
every page:

 

var ADFDialogReturn = new Array();

 

The problem is this - the polling doesn't stop when dialogs are opened
because self._pollManager is undefined, never allowing the call to
deactivateAll, and I don't see any references to _pollManager anywhere.

 

Can someone explain to me how that particular code is supposed to work?
I'd offer to fix this myself, but I don't understand where or how
_pollManager is referenced.

 

It would be great to have the dialogs close cleanly on a session
timeout, but if they can't for some reason, I'd prefer to see the
polling cease while dialogs are displayed.

 

Thanks in advance,

 

Shawn