ICEfaces
  1. ICEfaces
  2. ICE-6506

SelectOneListbox partialSubmit focus issue

    Details

      Description

      In a form if we have many <ice:selectOneListbox> where each one is partially submitted, or the whole form is partially submitted, then if user sets some value to first drop down by arrow keys(not with mouse) and then if user press tab key then the focus is again coming to first drop down instead of transferring to second drop down.

      This seems to only occur on Firefox. In IE the focus is kept on the next component. This also seems to effect the selectOneListbox, testing the same issue with selectOneMenu doesn't reproduce the same results.

      Sample code:

      <ice:form partialSubmit="true">
      <ice:panelGrid columns="1">
      <ice:selectOneListbox value="0" size="1">
      <f:selectItem itemValue="0" itemLabel="0"/>
      <f:selectItem itemValue="1" itemLabel="1"/>
      <f:selectItem itemValue="2" itemLabel="2"/>
      <f:selectItem itemValue="3" itemLabel="3"/>
      <f:selectItem itemValue="4" itemLabel="4"/>
      </ice:selectOneListbox >
      <ice:selectOneListbox value="0" size="1">
      <f:selectItem itemValue="0" itemLabel="0"/>
      <f:selectItem itemValue="1" itemLabel="1"/>
      <f:selectItem itemValue="2" itemLabel="2"/>
      <f:selectItem itemValue="3" itemLabel="3"/>
      <f:selectItem itemValue="4" itemLabel="4"/>
      </ice:selectOneListbox>
      <ice:selectOneListbox value="0" size="1">
      <f:selectItem itemValue="0" itemLabel="0"/>
      <f:selectItem itemValue="1" itemLabel="1"/>
      <f:selectItem itemValue="2" itemLabel="2"/>
      <f:selectItem itemValue="3" itemLabel="3"/>
      <f:selectItem itemValue="4" itemLabel="4"/>
      </ice:selectOneListbox>
      <ice:selectOneListbox value="0" size="1">
      <f:selectItem itemValue="0" itemLabel="0"/>
      <f:selectItem itemValue="1" itemLabel="1"/>
      <f:selectItem itemValue="2" itemLabel="2"/>
      <f:selectItem itemValue="3" itemLabel="3"/>
      <f:selectItem itemValue="4" itemLabel="4"/>
      </ice:selectOneListbox>

      </ice:panelGrid>
      </ice:form>

        Activity

        Arran Mccullough created issue -
        Arran Mccullough made changes -
        Field Original Value New Value
        Salesforce Case [5007000000FYNXE]
        Arran Mccullough made changes -
        Attachment Case9751Example.war [ 12826 ]
        Hide
        Arran Mccullough added a comment -

        Tested with ICEfaces EE 1.8.2 P01 and ICEfaces 1.8.2 with the same results.

        Show
        Arran Mccullough added a comment - Tested with ICEfaces EE 1.8.2 P01 and ICEfaces 1.8.2 with the same results.
        Ken Fyten made changes -
        Fix Version/s 1.8.2-EE-GA_P03 [ 10251 ]
        Tyler Johnson made changes -
        Salesforce Case [5007000000FYNXE] [5007000000FYNXE, 5007000000Fc0Vn]
        Ken Fyten made changes -
        Assignee Priority P2
        Assignee Mircea Toma [ mircea.toma ]
        Hide
        Mircea Toma added a comment -

        The difference in behavior between Firefox and IE is due to how these browsers fire the 'change' event.

        In Firefox the 'change' event is not triggered while selecting the different values in the drop-down. The 'change' event triggers the submit only while tabbing out, sending element's focus along. The focus retention mechanism on the server kicks in by sending back a JS command to re-apply the focus on the submitting element.

        In IE the 'change' event is triggered while selecting values in drop-down. After each submit the focus is re-applied on the same element by the same focus retention mechanism, this has no visible effect since the focus was not changed yet anyway. While tabbing out only 'onblur' event is triggered which does not cause a submit, thus focus can move freely to the next dropdown.

        Show
        Mircea Toma added a comment - The difference in behavior between Firefox and IE is due to how these browsers fire the 'change' event. In Firefox the 'change' event is not triggered while selecting the different values in the drop-down. The 'change' event triggers the submit only while tabbing out, sending element's focus along. The focus retention mechanism on the server kicks in by sending back a JS command to re-apply the focus on the submitting element. In IE the 'change' event is triggered while selecting values in drop-down. After each submit the focus is re-applied on the same element by the same focus retention mechanism, this has no visible effect since the focus was not changed yet anyway. While tabbing out only 'onblur' event is triggered which does not cause a submit, thus focus can move freely to the next dropdown.
        Ken Fyten made changes -
        Assignee Mircea Toma [ mircea.toma ] Ken Fyten [ ken.fyten ]
        Hide
        Ken Fyten added a comment -

        Mircea, if this is the case, then why does the focus change correctly when running the component-showcase app. with the Selection demo? If you use the keyboard on FF 4 to select a selectOneMenu item, then tab to leave the component, it partial-submits correctly and focus is placed on the next component in the page (correctly).

        Show
        Ken Fyten added a comment - Mircea, if this is the case, then why does the focus change correctly when running the component-showcase app. with the Selection demo? If you use the keyboard on FF 4 to select a selectOneMenu item, then tab to leave the component, it partial-submits correctly and focus is placed on the next component in the page (correctly).
        Ken Fyten made changes -
        Assignee Ken Fyten [ ken.fyten ] Mircea Toma [ mircea.toma ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24379 Tue Apr 12 07:05:27 MDT 2011 mircea.toma ICE-6506 Disable focus retention for submits triggered by 'change' events.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/renderkit/ListboxRenderer.java
        Hide
        Mircea Toma added a comment -

        In component-showcase the drop-down is rendered by ice:selectOneListbox while in the attached test case ice:selectOneMenu renders the drop-down. It looks like ice:selectOneMenu erases the current focus just before submitting the form thus disabling the focus retention temporarily.

        ice:selectOneListbox renders > ... onchange="Ice.selectChange(form,this,event,300);" ...
        ice:selectOneMenu renders > ... onchange="setFocus('');Ice.selectChange(form,this,event,300);" ...

        So, a small change in ice:selectOneListbox's renderer should fix the issue.

        Show
        Mircea Toma added a comment - In component-showcase the drop-down is rendered by ice:selectOneListbox while in the attached test case ice:selectOneMenu renders the drop-down. It looks like ice:selectOneMenu erases the current focus just before submitting the form thus disabling the focus retention temporarily. ice:selectOneListbox renders > ... onchange="Ice.selectChange(form,this,event,300);" ... ice:selectOneMenu renders > ... onchange="setFocus('');Ice.selectChange(form,this,event,300);" ... So, a small change in ice:selectOneListbox's renderer should fix the issue.
        Hide
        Mircea Toma added a comment -

        Disabled focus retention by setting focus to '' for submits triggered by 'change' events.

        Show
        Mircea Toma added a comment - Disabled focus retention by setting focus to '' for submits triggered by 'change' events.
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Ken Fyten added a comment -

        Should also consider changing this for the IF 2.0 compat component.

        Show
        Ken Fyten added a comment - Should also consider changing this for the IF 2.0 compat component.
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Ken Fyten added a comment -

        This will need to be committed to icefaces2/trunk and icefaces2/branches/icefaces-2.0.x-maintenance branch if applicable for compat.

        Show
        Ken Fyten added a comment - This will need to be committed to icefaces2/trunk and icefaces2/branches/icefaces-2.0.x-maintenance branch if applicable for compat.
        Ken Fyten made changes -
        Fix Version/s EE-2.0.0.GA [ 10263 ]
        Fix Version/s 2.1 [ 10241 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24388 Thu Apr 14 07:59:14 MDT 2011 mircea.toma ICE-6506 Disable focus retention for submits triggered by 'change' events in order to avoid re-focusing the submitting element while tabbing out.
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/renderkit/ListboxRenderer.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24389 Thu Apr 14 07:59:56 MDT 2011 mircea.toma ICE-6506 Disable focus retention for submits triggered by 'change' events in order to avoid re-focusing the submitting element while tabbing out.
        Files Changed
        Commit graph MODIFY /icefaces2/branches/icefaces-2.0.x-maintenance/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/renderkit/ListboxRenderer.java
        Hide
        Mircea Toma added a comment -

        Applied fixes to icefaces2/trunk and icefaces2/branches/icefaces-2.0.x-maintenance.

        Show
        Mircea Toma added a comment - Applied fixes to icefaces2/trunk and icefaces2/branches/icefaces-2.0.x-maintenance.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 2.0.2 [ 10273 ]
        Fix Version/s 2.1 [ 10241 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P2

          People

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

            Dates

            • Created:
              Updated:
              Resolved: