ICEfaces
  1. ICEfaces
  2. ICE-5644

Retain window focus in IE when background window is updated

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2-EE-GA, 1.8.2-EE-GA_P01
    • Fix Version/s: 1.8.2-EE-GA_P02, 2.0.0
    • Component/s: Framework, ICE-Components
    • Labels:
      None
    • Environment:
      IE
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.)

      Description

      Use Case: In a multiple window application a user can open a new window in the browser that will be a new page. If a long process is executed in the new (child) window and the user goes back to a parent window. Once the processing of the child window finishes, in IE only, the focus is moved to this new window.

      If the user does no actions/interaction with the parent page then once the child window completes its processing the window is displayed to the user. If the user is interacting with the page ex: entering data/clicking, the focus is moved to the child window but the window is not displayed (due to the interactions with the parent page, the window is displayed but focus is set back to the parent page).

      In Firefox, focus is not applied to the child window. The user is allowed to continue any processing on the parent window without interference from the child window.

        Activity

        Hide
        Ken Fyten added a comment -

        Perhaps there is something we could can do in terms of detecting if the current viewport that focus is being set into is in a window that has focus, if not, ignore setting the focus. ?

        Show
        Ken Fyten added a comment - Perhaps there is something we could can do in terms of detecting if the current viewport that focus is being set into is in a window that has focus, if not, ignore setting the focus. ?
        Hide
        Mircea Toma added a comment -

        When focus is applied on an element in the child window IE brings the window in front. This behavior seems to be IE specific.

        To avoid this issue the bridge belonging to the blurred window will avoid applying focus on the elements, but it will save the ID of the element needing to receive focus. When the child window receives back the focus it will apply the focus on the element corresponding to the saved ID.

        Another hurdle posed by IE was window.onblur behavior which is not in line with the behavior the reset of the browsers have. IE incorrectly fire 'onblur' events when focus moves from the window to some element inside the same window. Normally the event should be fired only when focus moves from one window to another.
        To fix this issue the IE specific event listener document.onfocusout is used. The document.onfocusout allows to differentiate between a window blur due to a focus moved on an internal element versus focus moved on a different window.

        Show
        Mircea Toma added a comment - When focus is applied on an element in the child window IE brings the window in front. This behavior seems to be IE specific. To avoid this issue the bridge belonging to the blurred window will avoid applying focus on the elements, but it will save the ID of the element needing to receive focus. When the child window receives back the focus it will apply the focus on the element corresponding to the saved ID. Another hurdle posed by IE was window.onblur behavior which is not in line with the behavior the reset of the browsers have. IE incorrectly fire 'onblur' events when focus moves from the window to some element inside the same window. Normally the event should be fired only when focus moves from one window to another. To fix this issue the IE specific event listener document.onfocusout is used. The document.onfocusout allows to differentiate between a window blur due to a focus moved on an internal element versus focus moved on a different window.
        Hide
        Mircea Toma added a comment -
        Show
        Mircea Toma added a comment - See how IE behavior differs and the workaround: http://pro-thoughts.blogspot.com/2006/10/incorrect-behavior-of-windowonblur.html .
        Hide
        Ken Fyten added a comment -

        Need to revert this change as it causes a serious regression in ICE-6262.

        Show
        Ken Fyten added a comment - Need to revert this change as it causes a serious regression in ICE-6262.
        Hide
        Ken Fyten added a comment -

        Need to add this feature to ICEfaces 2.0 also.

        Show
        Ken Fyten added a comment - Need to add this feature to ICEfaces 2.0 also.
        Hide
        Mircea Toma added a comment - - edited

        Introduced com.icesoft.faces.windowFocusRestore configuration parameter for the enabling/disabling of focus restoring when using multiple windows. 1.8 only.
        com.icefaces.face.windowFocusRestore is set to 'false' which effectively disables window focus restoring by default.

        Show
        Mircea Toma added a comment - - edited Introduced com.icesoft.faces.windowFocusRestore configuration parameter for the enabling/disabling of focus restoring when using multiple windows. 1.8 only. com.icefaces.face.windowFocusRestore is set to 'false' which effectively disables window focus restoring by default.
        Hide
        Mircea Toma added a comment - - edited

        Changed the focus code in 2.0/compat to reference current focus strategy indirectly so that ice.applyFocus alias (for local var applyFocus) is automatically following the reference to the chosen focus strategy.

        Show
        Mircea Toma added a comment - - edited Changed the focus code in 2.0/compat to reference current focus strategy indirectly so that ice.applyFocus alias (for local var applyFocus) is automatically following the reference to the chosen focus strategy.
        Hide
        Mircea Toma added a comment -

        Made 1.8 focus code to run in IE only.

        Show
        Mircea Toma added a comment - Made 1.8 focus code to run in IE only.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: