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

VirtualFlow creates extra cells at the bottom

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • None
    • javafx

      The VirtualFlow is creating at least one extra cell (row) when you get at the very bottom of the TableView.

      The thing is that the method "computeCurrentIndex()" can return a number equal to "getCellCount()". But the "cellCount" variable is equal to "getItems().size()". So if my cellCount is equal to 10, I should create cell with index going from 0 to 9. But it shouldn't create a cell with index set at 10.

      What I suggest is to modify the two functions adding cells,first in "addLeadingCells()" in order to add that condition into the "while" loop:
      if(index >= getCellCount()){
      if (first) {
      first = false;
      }
      --index;
      }else{
      //Do normal method
      }

      Then in "addTrailingCells()" by simply putting an extra condition into the "while" loop:
      while (offset < viewportLength && index < getCellCount()) {
      ....
      }

      But the "addTrailingCells" takes a parameter called "fillEmptyCells". I don't know why it's here, and what it's supposed to do but adding extra cell that will receive no item can lead to strange behavior.

      Problem may be linked with : https://javafx-jira.kenai.com/browse/RT-31252

          Loading...
          Uploaded image for project: 'JDK'
          1. JDK
          2. JDK-8117647

          VirtualFlow creates extra cells at the bottom

            • Icon: Bug Bug
            • Resolution: Not an Issue
            • Icon: P4 P4
            • None
            • None
            • javafx

              The VirtualFlow is creating at least one extra cell (row) when you get at the very bottom of the TableView.

              The thing is that the method "computeCurrentIndex()" can return a number equal to "getCellCount()". But the "cellCount" variable is equal to "getItems().size()". So if my cellCount is equal to 10, I should create cell with index going from 0 to 9. But it shouldn't create a cell with index set at 10.

              What I suggest is to modify the two functions adding cells,first in "addLeadingCells()" in order to add that condition into the "while" loop:
              if(index >= getCellCount()){
              if (first) {
              first = false;
              }
              --index;
              }else{
              //Do normal method
              }

              Then in "addTrailingCells()" by simply putting an extra condition into the "while" loop:
              while (offset < viewportLength && index < getCellCount()) {
              ....
              }

              But the "addTrailingCells" takes a parameter called "fillEmptyCells". I don't know why it's here, and what it's supposed to do but adding extra cell that will receive no item can lead to strange behavior.

              Problem may be linked with : https://javafx-jira.kenai.com/browse/RT-31252

                    jgiles Jonathan Giles
                    shadzic Samir Hadzic
                    Votes:
                    0 Vote for this issue
                    Watchers:
                    2 Start watching this issue

                      Created:
                      Updated:
                      Resolved:
                      Imported:

                        jgiles Jonathan Giles
                        shadzic Samir Hadzic
                        Votes:
                        0 Vote for this issue
                        Watchers:
                        2 Start watching this issue

                          Created:
                          Updated:
                          Resolved:
                          Imported: