ICEfaces
  1. ICEfaces
  2. ICE-6641

DataTable: non-client id rendered on header div can lead to anomalous DOM updates when using multiple dataTables on the page

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-EE-Beta1
    • Fix Version/s: 2.0.1
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      n/a

      Description

      The TableRenderer is rendering a non-client id on the header div:

      TablerRenderer: line 438:
      columnHeaderDiv.setAttribute(HTML.ID_ATTR, "hdrDv"+ columnIndex);

      If there are multiple dataTables on the page, they will have identical element id's on the rendered header divs. If a change occurs within the header div of the first dataTable, the DOM diff may become anchored at the non-unique id of the header div without reference to the unique dataTable id. This DOM update will then be inserted into the 1st dataTable, leading to anomalous updates.

        Activity

        Philip Breau created issue -
        Philip Breau made changes -
        Field Original Value New Value
        Summary DataTable: non-unique id rendered on header div can lead to anomalous DOM updates when using multiple dataTables on the page DataTable: non-client id rendered on header div can lead to anomalous DOM updates when using multiple dataTables on the page
        Salesforce Case []
        Description The TableRenderer is rendering a non-unique id on the header div:

        TablerRenderer: line 438:
        columnHeaderDiv.setAttribute(HTML.ID_ATTR, "hdrDv"+ columnIndex);

        If there are multiple dataTables on the page, they will have identical element id's on the rendered header divs. If a change occurs within the header div of the first dataTable, the DOM diff may become anchored at the non-unique id of the header div without reference to the unique dataTable id. This DOM update will then be inserted into the 1st dataTable, leading to anomalous updates.
        The TableRenderer is rendering a non-client id on the header div:

        TablerRenderer: line 438:
        columnHeaderDiv.setAttribute(HTML.ID_ATTR, "hdrDv"+ columnIndex);

        If there are multiple dataTables on the page, they will have identical element id's on the rendered header divs. If a change occurs within the header div of the first dataTable, the DOM diff may become anchored at the non-unique id of the header div without reference to the unique dataTable id. This DOM update will then be inserted into the 1st dataTable, leading to anomalous updates.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24095 Fri Mar 04 14:36:17 MST 2011 philip.breau ICE-6641 - DataTable header div id not using client id
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/renderkit/TableRenderer.java
        Hide
        Philip Breau added a comment -

        suggested fix:

        Index: C:/work/projects/icefaces-ee2/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/renderkit/TableRenderer.java
        ===================================================================
        — C:/work/projects/icefaces-ee2/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/renderkit/TableRenderer.java (revision 24082)
        +++ C:/work/projects/icefaces-ee2/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/renderkit/TableRenderer.java (working copy)
        @@ -435,7 +435,7 @@
        tr.appendChild(handlerTd);
        }
        Element columnHeaderDiv = domContext.createElement(HTML.DIV_ELEM);

        • columnHeaderDiv.setAttribute(HTML.ID_ATTR, "hdrDv"+ columnIndex);
          + columnHeaderDiv.setAttribute(HTML.ID_ATTR, ClientIdPool.get(htmlDataTable.getClientId(facesContext)UINamingContainer.getSeparatorChar(facesContext)"hdrDv"+ columnIndex));
          th.appendChild(columnHeaderDiv);
          if (htmlDataTable.isResizable()) {
          String nextWidth = htmlDataTable.getNextResizableTblColumnWidth();
          @@ -511,7 +511,7 @@
          Element cursorParent = th;
          if (htmlDataTable.isResizable()) {
          Element columnHeaderDiv = domContext.createElement(HTML.DIV_ELEM);
        • columnHeaderDiv.setAttribute(HTML.ID_ATTR, "hdrDv"+ columnIndex);
          + columnHeaderDiv.setAttribute(HTML.ID_ATTR, ClientIdPool.get(htmlDataTable.getClientId(facesContext)UINamingContainer.getSeparatorChar(facesContext)"hdrDv"+ columnIndex);
          th.appendChild(columnHeaderDiv);
          width = htmlDataTable.getNextResizableTblColumnWidth();
          if (width != null) {
        Show
        Philip Breau added a comment - suggested fix: Index: C:/work/projects/icefaces-ee2/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/renderkit/TableRenderer.java =================================================================== — C:/work/projects/icefaces-ee2/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/renderkit/TableRenderer.java (revision 24082) +++ C:/work/projects/icefaces-ee2/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/renderkit/TableRenderer.java (working copy) @@ -435,7 +435,7 @@ tr.appendChild(handlerTd); } Element columnHeaderDiv = domContext.createElement(HTML.DIV_ELEM); columnHeaderDiv.setAttribute(HTML.ID_ATTR, "hdrDv"+ columnIndex); + columnHeaderDiv.setAttribute(HTML.ID_ATTR, ClientIdPool.get(htmlDataTable.getClientId(facesContext) UINamingContainer.getSeparatorChar(facesContext) "hdrDv"+ columnIndex)); th.appendChild(columnHeaderDiv); if (htmlDataTable.isResizable()) { String nextWidth = htmlDataTable.getNextResizableTblColumnWidth(); @@ -511,7 +511,7 @@ Element cursorParent = th; if (htmlDataTable.isResizable()) { Element columnHeaderDiv = domContext.createElement(HTML.DIV_ELEM); columnHeaderDiv.setAttribute(HTML.ID_ATTR, "hdrDv"+ columnIndex); + columnHeaderDiv.setAttribute(HTML.ID_ATTR, ClientIdPool.get(htmlDataTable.getClientId(facesContext) UINamingContainer.getSeparatorChar(facesContext) "hdrDv"+ columnIndex); th.appendChild(columnHeaderDiv); width = htmlDataTable.getNextResizableTblColumnWidth(); if (width != null) {
        Ken Fyten made changes -
        Salesforce Case []
        Fix Version/s 2.0.0-EE-GA [ 10263 ]
        Fix Version/s 2.0.1 [ 10255 ]
        Assignee Priority P1
        Assignee Mark Collette [ mark.collette ]
        Hide
        Mark Collette added a comment -

        Yes, the change looks correct, incorporating the clientId. Although the second line seems to be missing a closing ) after the word columnIndex.

        Show
        Mark Collette added a comment - Yes, the change looks correct, incorporating the clientId. Although the second line seems to be missing a closing ) after the word columnIndex.
        Hide
        Mark Collette added a comment -

        Back to Philip to commit.

        Show
        Mark Collette added a comment - Back to Philip to commit.
        Mark Collette made changes -
        Salesforce Case []
        Assignee Mark Collette [ mark.collette ] Philip Breau [ philip.breau ]
        Hide
        Philip Breau added a comment -

        added client id to both header div ids

        Show
        Philip Breau added a comment - added client id to both header div ids
        Philip Breau made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 2.0.0-EE-GA [ 10263 ]
        Ken Fyten made changes -
        Assignee Priority P1
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Philip Breau
            Reporter:
            Philip Breau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: