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

AccumCell should not be visible



    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • jfx17
    • jfx17
    • javafx
    • None


      The recent refactoring of the cell size calculations in VirtualFlow (https://bugs.openjdk.java.net/browse/JDK-8089589), introduced an approach where the total calculated size of a flow of items is gradually calculated -- to balance between performance and user expercience.
      The calculations for each item in the list are done gradually, even if the items are far from visible yet. This is done using the accumCell in VirtualFlow, which index is set to the item we want to inspect. This will lead to a call to Cell.updateItem(). That was already happening before, but it is happening more often now in case the gradual caching goes faster than the scrolling.

      This may break logic in updateItem implementations that use the index of the current cell. For example, a paging mechanism might decide to retrieve new items when the almost-last rows are considered.
      With the gradual calculation approach, those rows are considered (i.e. the updateItem is called) but they are not visible, as they are info is contained in the accumCell, which is added to a Parent which is invisible. However, the accumCell itself might be visible.

      In order to allow this logic to still be possible, I suggest the accumCell should always made be invisble after it has done its work. That way, the `updateItem` can clearly decide what to do, based on not only the index, but also the visibility of the considered item.


        Issue Links



              jvos Johan Vos
              jvos Johan Vos
              0 Vote for this issue
              3 Start watching this issue