Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8185887

TableRowSkinBase fails to correctly virtualize cells in horizontal direction

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • jfx25
    • jfx11, 8, 9, 10, jfx15
    • javafx
    • None
    • master

      At some point (yet to be determined) there appears to have been a regression in the TableRowSkinBase code when attempting to virtualise cells in horizontal direction (i.e. when there are more columns than the visible area allows).

      The patch below resolves the issue, but it is not likely the correct solution (we are trying to determine the table width, but we are getting the width and padding on the underlying virtualflow (the width is fine, the padding should really come from tableview directly):

      diff --git a/modules/javafx.controls/src/main/java/javafx/scene/control/skin/TableRowSkinBase.java b/modules/javafx.controls/src/main/java/javafx/scene/control/skin/TableRowSkinBase.java
      --- a/modules/javafx.controls/src/main/java/javafx/scene/control/skin/TableRowSkinBase.java
      +++ b/modules/javafx.controls/src/main/java/javafx/scene/control/skin/TableRowSkinBase.java
      @@ -680,8 +680,8 @@
               double end = start + col.getWidth();
       
               // determine the width of the table
      - final Insets padding = getSkinnable().getPadding();
      - double headerWidth = getSkinnable().getWidth() - padding.getLeft() + padding.getRight();
      + final Insets padding = getVirtualFlow().getPadding();
      + double headerWidth = getVirtualFlow().getWidth() - padding.getLeft() + padding.getRight();
       
               return (start >= scrollX || end > scrollX) && (start < (headerWidth + scrollX) || end <= (headerWidth + scrollX));
           }

      This patch does however help scrolling performance drastically when there are considerable numbers of columns, e.g. JDK-8166956

            mhanl Marius Hanl
            jgiles Jonathan Giles
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: