myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shawn Bertrand (JIRA)" <...@myfaces.apache.org>
Subject [jira] Created: (TRINIDAD-1069) Polling remains in place when dialogs displayed due to use of unreferenced JS variable
Date Thu, 08 May 2008 15:32:55 GMT
Polling remains in place when dialogs displayed due to use of unreferenced JS variable
--------------------------------------------------------------------------------------

                 Key: TRINIDAD-1069
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1069
             Project: MyFaces Trinidad
          Issue Type: Bug
          Components: Components
    Affects Versions: 1.0.7-core
            Reporter: Shawn Bertrand


According to the code in Window.js, any polling component in place for a window which spawns
a dialog should be disabled for the life of the dialog, and reinstated once the dialog is
closed.  The code which disables the polling can be found in Window.js in the launchWindow
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();
    }

When the dialog closes, this code will reinstate the poll interval:

    // Keeps checking for absence of a modal dependent, when found
    //  reactivates all poll, and stops checking any further
    function _pollWhenModalDependentCloses()
    {
      if (!_getValidModalDependent(self))
      {
        _pollManager.reactivateAll();
      }
      else
      {
        // pu: Call thyself to check again after a second
        //  If more accuracy required, set it to a millisecond
        self.setTimeout("_pollWhenModalDependentCloses()", 1000);
      }
}

The reference to _pollManager isn't valid, as the variable on the window which does contain
the poll manager is actually _trPollManager.

I've tested this with changing _pollManager to _trPollManager, and it works as expected: 
polling is disabled until the dialog goes away.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message