ICEfaces
  1. ICEfaces
  2. ICE-9521

ice:selectOneMenu/selectOneRadio - focus lost after updating component style

    Details

    • Assignee Priority:
      P1
    • Salesforce Case Reference:

      Description

      In this use case, code has been added so that when an ice:selectOneMenu or an ice:selectOneRadio button value is submitted, the CSS is changed for this to indicate that it has been submitted.

      The issue here is that when the style is change, focus is now lost. This seems to be an issue with both the ICE components and the same standard JSF components.

        Activity

        Hide
        Arran Mccullough added a comment -

        Attached test case and source code. The following ICEfaces jars need to be added to the war:

        • icefaces-ee.jar
        • icefaces-ee-ace.jar
        • icefaces-ee-ext.jar
        • icefaces-ee-compat.jar

        Steps:

        • Load welcomeICEfaces.jsf
        • Select a value from the drop down or radio buttons.
        • CSS is changed for the component but focus is now lost. You should be able to tab to the next input.
        Show
        Arran Mccullough added a comment - Attached test case and source code. The following ICEfaces jars need to be added to the war: icefaces-ee.jar icefaces-ee-ace.jar icefaces-ee-ext.jar icefaces-ee-compat.jar Steps: Load welcomeICEfaces.jsf Select a value from the drop down or radio buttons. CSS is changed for the component but focus is now lost. You should be able to tab to the next input.
        Hide
        Mircea Toma added a comment -

        Modified ice.applyFocus function to look at document.activeElement variable instead of currentFocus when deciding to re-apply focus on the submitting element.

        Also, modified HtmlSelectOneRadio.getOnClick method to return JS code that sets the focus before the partial submit. Previously the focus was cleared just before the partial submit was invoked to cancel the focus retention, a strategy that is required when submitting on the blur event to avoid moving back the focus while tabbing. In this case though the partial submit is triggered during a click event which also sets the focus on the element.

        Show
        Mircea Toma added a comment - Modified ice.applyFocus function to look at document.activeElement variable instead of currentFocus when deciding to re-apply focus on the submitting element. Also, modified HtmlSelectOneRadio.getOnClick method to return JS code that sets the focus before the partial submit. Previously the focus was cleared just before the partial submit was invoked to cancel the focus retention, a strategy that is required when submitting on the blur event to avoid moving back the focus while tabbing. In this case though the partial submit is triggered during a click event which also sets the focus on the element.
        Hide
        Mircea Toma added a comment - - edited

        As for the h:* components, the focus retention feature we have does not work with them unless the components are decorated with the correct JS code.

        Show
        Mircea Toma added a comment - - edited As for the h:* components, the focus retention feature we have does not work with them unless the components are decorated with the correct JS code.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: