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

        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.
        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); }

          People

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

            Dates

            • Created:
              Updated:
              Resolved: