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

TableView: Click on right trough has no effect when cell height is higher than viewport height

XMLWordPrintable

    • b06
    • x86_64
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.8.0_112"
      Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      Using a JavaFX TableView, a click on the right trough has no effect when the cell height of the cell currently displayed is higher than viewport height.
      The ScrollBar ist displayed with a minimal height.

      This seems to be caused by a bug in VirtualFlow.java (around line 1618):
                  for (int i = 0, max = cells.size(); i < max; i++) {
                      T cell = cells.get(i);
                      if (cell != null && !cell.isEmpty()) {
                          sumCellLength += (isVertical ? cell.getHeight() : cell.getWidth());
                          if (sumCellLength > flowLength) {
                              break;
                          }

                          numCellsVisibleOnScreen++;
                      }
                  }
                lengthBar.setMax(1);
                  if (numCellsVisibleOnScreen == 0 && cellCount == 1) {
                          // special case to help resolve RT-17701 and the case where we have
                      // only a single row and it is bigger than the viewport
                      lengthBar.setVisibleAmount(flowLength / sumCellLength);
                  } else {
                      lengthBar.setVisibleAmount(numCellsVisibleOnScreen / (float) cellCount);

      In this case, when the cellCount is > 1 and the cell´s height is greater than the flowLength, the visibleAmount is set to zero. I think that the numCellsVisibleOnScreen should be a fraction number instead of an integer value.



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      create a TableView with one or more columns and more than one row and set the height of each cell (determined by the CellFactory) to a value greater than the TableView´s height.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Clicking the trough should cause a scroll to the correct part of the table also when the cells´ height is greater than the TableView´s height. The ScrollBar should be drawn with the correct height also when the cells´ height is greater than the TableView´s height.

      ACTUAL -
      Using a JavaFX TableView, a click on the right trough has no effect when the cell height of the cell currently displayed is higher than viewport height.
      The ScrollBar ist displayed with a minimal height.

      REPRODUCIBILITY :
      This bug can be reproduced always.

            kcr Kevin Rushforth
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: