ICEfaces
  1. ICEfaces
  2. ICE-10146

ace:rowEditor - re-apply focus to row editor buttons after toggling edit mode

    Details

      Description

      When executing an edit in an editable ace:dataTable, this updates includes the entire table source in the update as well as the updates for the cellEditor id's.

      This request is to investigate if this behavior can be changed to include just the cell editor and not the entire table source.

      One use case where this is an issue is when editStart contains as a source the whole table which makes it extremely difficult to regain focus on the last clicked cell editor.

        Activity

        Hide
        Deryk Sinotte added a comment -

        Assigning to Art to be fixed in the next EE release.

        Show
        Deryk Sinotte added a comment - Assigning to Art to be fixed in the next EE release.
        Hide
        Arturo Zambrano added a comment -

        The wording in the issue description and in the comments from the costumer in the support case are very unclear. However, it seems like their main concern is with focusing the cell editor buttons, as can be gleaned from this comment:

        "this.behaviors.editStart has as Ajax source the datatable object and NOT the cell editor. This means if you want to restore the focus after the ajax request you can't use the source as focusing the table object won't set your focus on the last clicked button (the cell editor button in this case). Does this make sense?"

        When they talk about the 'source', they seem to be referring to the 'javax.faces.source' parameter in the request or the 'source' value in the ajax behaviour properties object. In any case, this is not what determines what element is focused after the response is received. That is controlled by the 'ice.focus' request parameter. Moreover, the buttons they refer to are actually part of the ace:rowEditor component, since ace:cellEditor is basically used as a facet container to render one or the other set of components, depending on whether the row is in edit mode or not.

        So, I added client ids to the ace:rowEditor button that toggles edit mode on and the button that submits an editable row. The id is the same for both (only one of them gets rendered at a time) in order to let the bridge handle the 'ice.focus' parameter and thus give focus to these buttons whenever the edit state is toggled on and off. However, the 'cancel edit' button won't have this behaviour because the 'submit edit' button already has the client id that is shared with the 'start edit' button, and two elements can't have the same id at the same time.

        This is as best as this can get, since explicitly setting the 'ice.focus' parameter to that of the id of the button that we want to focus after the response will not work, since it will be overridden by the bridge, and explicitly calling ice.setFocus() with another id will remove the focus from the current focused button and will not work either because the button we want to focus is not rendered yet.

        The fix was committed to the 4.0 trunk at revision 43854 and to the 3.3 EE maintenance branch at revision 43856.

        Show
        Arturo Zambrano added a comment - The wording in the issue description and in the comments from the costumer in the support case are very unclear. However, it seems like their main concern is with focusing the cell editor buttons, as can be gleaned from this comment: "this.behaviors.editStart has as Ajax source the datatable object and NOT the cell editor. This means if you want to restore the focus after the ajax request you can't use the source as focusing the table object won't set your focus on the last clicked button (the cell editor button in this case). Does this make sense?" When they talk about the 'source', they seem to be referring to the 'javax.faces.source' parameter in the request or the 'source' value in the ajax behaviour properties object. In any case, this is not what determines what element is focused after the response is received. That is controlled by the 'ice.focus' request parameter. Moreover, the buttons they refer to are actually part of the ace:rowEditor component, since ace:cellEditor is basically used as a facet container to render one or the other set of components, depending on whether the row is in edit mode or not. So, I added client ids to the ace:rowEditor button that toggles edit mode on and the button that submits an editable row. The id is the same for both (only one of them gets rendered at a time) in order to let the bridge handle the 'ice.focus' parameter and thus give focus to these buttons whenever the edit state is toggled on and off. However, the 'cancel edit' button won't have this behaviour because the 'submit edit' button already has the client id that is shared with the 'start edit' button, and two elements can't have the same id at the same time. This is as best as this can get, since explicitly setting the 'ice.focus' parameter to that of the id of the button that we want to focus after the response will not work, since it will be overridden by the bridge, and explicitly calling ice.setFocus() with another id will remove the focus from the current focused button and will not work either because the button we want to focus is not rendered yet. The fix was committed to the 4.0 trunk at revision 43854 and to the 3.3 EE maintenance branch at revision 43856.

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: