Details

    • Assignee Priority:
      P2
    • Support Case References:
    • Workaround Exists:
      Yes
    • Workaround Description:
      The workaround would be to delay the execution of _window.open(...)_. See comments.

      Description

      In this particulat scenario, an ice:dataTable is set with an ice:rowSelector. Upon selecting a row, a window.open JavaScript call is made from the selectionListener.

      When testing in IE browsers, this new window is sent behind the parent window. This seems to be caused by the ICEfaces focus management setting focus onto the row selector tag.

      This seems to be only caused by calling this code from the row selector. If the same code is called through an ice/h commandButton, the focus remains on the new window.

      This is similar to what was reported in ICE-5644.

        Activity

        Arran Mccullough created issue -
        Hide
        Arran Mccullough added a comment -

        Attached test case that shows the issue. Note: the icefaces-ee-ace.jar and icefaces-ee-compat.jar files need to be added back into the war for it to run.

        Steps:

        • Load welcomeICEfaces.jsf in IE
        • Click on a row in the dataTable, a new window is opened, but then pushed behind the parent window.
        • Clicking on the buttons causes the new window to remain focused.
        Show
        Arran Mccullough added a comment - Attached test case that shows the issue. Note: the icefaces-ee-ace.jar and icefaces-ee-compat.jar files need to be added back into the war for it to run. Steps: Load welcomeICEfaces.jsf in IE Click on a row in the dataTable, a new window is opened, but then pushed behind the parent window. Clicking on the buttons causes the new window to remain focused.
        Arran Mccullough made changes -
        Field Original Value New Value
        Attachment Case13053Example.war [ 17482 ]
        Attachment Case13053Example.zip [ 17483 ]
        Ken Fyten made changes -
        Assignee Mircea Toma [ mircea.toma ]
        Fix Version/s EE-4.0.0.GA [ 11171 ]
        Fix Version/s EE-3.3.0.GA_P03 [ 11572 ]
        Assignee Priority P2 [ 10011 ]
        Hide
        Mircea Toma added a comment - - edited

        There's nothing wrong with the focus retention mechanism. TestBean is using JavaScriptRunner API to send the code needed to open the page. Right after that the focus retention is also sending code to apply focus on the submitting element.
        Since the JavaScriptRunner API does not provide any ordering or priority for the code sent for evaluation the workaround would be to delay the execution of window.open(...).
        The TestBean methods should look like this:

        public void rowSelected(RowSelectorEvent event) {
            System.out.println("Row Selected");
            String js = "setTimeout(function() {window.open('page.xhtml', '_blank', 'height=400,width=400');}, 150);";
            JavaScriptRunner.runScript(FacesContext.getCurrentInstance(), js);
        }
        
        public void open(ActionEvent event){
            String js = "setTimeout(function() {window.open('page.xhtml', '_blank', 'height=400,width=400');}, 150);";
            JavaScriptRunner.runScript(FacesContext.getCurrentInstance(), js);
        }
        
        Show
        Mircea Toma added a comment - - edited There's nothing wrong with the focus retention mechanism. TestBean is using JavaScriptRunner API to send the code needed to open the page. Right after that the focus retention is also sending code to apply focus on the submitting element. Since the JavaScriptRunner API does not provide any ordering or priority for the code sent for evaluation the workaround would be to delay the execution of window.open(...) . The TestBean methods should look like this: public void rowSelected(RowSelectorEvent event) { System .out.println( "Row Selected" ); String js = "setTimeout(function() {window.open('page.xhtml', '_blank', 'height=400,width=400');}, 150);" ; JavaScriptRunner.runScript(FacesContext.getCurrentInstance(), js); } public void open(ActionEvent event){ String js = "setTimeout(function() {window.open('page.xhtml', '_blank', 'height=400,width=400');}, 150);" ; JavaScriptRunner.runScript(FacesContext.getCurrentInstance(), js); }
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Won't Fix [ 2 ]
        Mircea Toma made changes -
        Workaround Description Disable the ICEfaces focus managedment on the page with the following parameter:

        <icecore:config focusManaged="false"/>
        The workaround would be to delay the execution of _window.open(...)_. See comments.
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: