ICEfaces
  1. ICEfaces
  2. ICE-9907

ace:dialog - Focus is not set to first input on opening of dialog

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.3.0.GA_P01, EE-3.3.0.GA_P02
    • Fix Version/s: 4.0, EE-3.3.0.GA_P03
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      All
    • Support Case References:
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      To disable the ICEfaces focus the following ace:ajax tag can be used on the component opening the dialog:

                      <h:commandButton value="Open" id="openBtn"
                                       actionListener="#{testBean.toggleDialog}">
                          <ace:ajax onStart="ice.setFocus(null); return true;" />
                      </h:commandButton>
      Show
      To disable the ICEfaces focus the following ace:ajax tag can be used on the component opening the dialog:                 <h:commandButton value="Open" id="openBtn"                                  actionListener="#{testBean.toggleDialog}">                     <ace:ajax onStart="ice.setFocus(null); return true;" />                 </h:commandButton>

      Description

      When opening an ace:dialog that includes an input element, focus is set momentarily to the input and then it is lost to the underlying component. With the P01 release, this is only an issue when using the visible attribute to show/hide the dialog. Using the widgetVar to show/hide the dialog allows the focus to remain on the dialog input field.

      Note: In testing with the latest code base, it looks like the widgetVar technique is no longer working. Focus is lost to the underlying component.

      The main issue is that the ICEfaces managed focus is setting focus back to the component that opened the dialog. In the case of a dialog it would be better if it had focus instead of a component that can't be used due to a modal layer. Also if this could be configurable that would also be a nice feature to have.

        Issue Links

          Activity

          Hide
          Arran Mccullough added a comment -

          Attached test case that shows the issues. Note: the icefaces-ace, icefaces, and icefaces-compat jar files need to be added to run the war.

          Steps:

          • Load welcomeICEfaces.jsf
          • Page displays two panels with buttons, one server side, and one client. Depending on the version open the the dialog will or won't set focus to the input field.
          Show
          Arran Mccullough added a comment - Attached test case that shows the issues. Note: the icefaces-ace, icefaces, and icefaces-compat jar files need to be added to run the war. Steps: Load welcomeICEfaces.jsf Page displays two panels with buttons, one server side, and one client. Depending on the version open the the dialog will or won't set focus to the input field.
          Hide
          Ken Fyten added a comment -

          Add dependency link to ICE-9962 for ultimate solution to this issue.

          Show
          Ken Fyten added a comment - Add dependency link to ICE-9962 for ultimate solution to this issue.
          Hide
          Mircea Toma added a comment -

          Fixed maintenance branch by delaying dialog applied focus thus making sure that 'setFocus' takes precedence over focus retention.

          The fix is already applied to trunk, see : http://jira.icesoft.org/browse/ICE-9500?focusedCommentId=53925&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-53925

          Show
          Mircea Toma added a comment - Fixed maintenance branch by delaying dialog applied focus thus making sure that 'setFocus' takes precedence over focus retention. The fix is already applied to trunk, see : http://jira.icesoft.org/browse/ICE-9500?focusedCommentId=53925&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-53925
          Hide
          Liana Munroe added a comment - - edited

          Verified fixed when adding type="button" to the <h:commandButton> tag in the test case. ICEfaces ee- 3.3.0 maintnenance branch r42510. Tomcat 7, all browsers.

          Show
          Liana Munroe added a comment - - edited Verified fixed when adding type="button" to the <h:commandButton> tag in the test case. ICEfaces ee- 3.3.0 maintnenance branch r42510. Tomcat 7, all browsers.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: