JDK-8185887 : TableRowSkinBase fails to correctly virtualize cells in horizontal direction
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: jfx11,8,9,10,jfx15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-08-06
  • Updated: 2025-02-07
  • Resolved: 2025-02-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
jfx25 b03Fixed
Related Reports
Blocks :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
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
Comments
Changeset: 1b12c8a4 Branch: master Author: Marius Hanl <mhanl@openjdk.org> Date: 2025-02-04 08:35:28 +0000 URL: https://git.openjdk.org/jfx/commit/1b12c8a490a87691e7e815a7e768854354cb54aa
04-02-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx/pull/1644 Date: 2024-11-22 16:32:49 +0000
22-11-2024

For convenience, copying part of a comment from the blocked issue JDK-8277000, there might be several (more or less separate) thingies to consider: - why does row.computePrefWidth asked its children? wouldn't it be more reasonable to ask the column's pref/width? - how to solve the mis-match of computation: ask children for pref/width in computeXX, ask columns for width in isColumnPartiallyVisible(..) - should/how to fix the base implementation to not rely on state initialized by subclasses?
15-11-2021

just to not loose anything: JDK-8166956 is the variant for TreeTableView with an example demonstrating the effect of horizontal virtualization (before/after PR #125) - there might be effects specific to TreeTableView not yet fully covered.
09-09-2020

This is one of 4 discrete performance issues split out from JDK-8185886. It is under review here: https://github.com/openjdk/jfx/pull/125
08-09-2020