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

Update the documentation of Virtualized controls to include the best practice of not using Nodes directly in the item list

XMLWordPrintable

    • b17
    • generic
    • generic

        This has come up while analyzing JDK-8277437.

        It is potentially problematic if an Application creates a list of Nodes that it passes into the ListView as the item list. This approach can cause problems with virtualized controls such as ComboBox, ListView, TableView, and TreeTableView, and is not a recommended pattern.


        The documentation for ComboBox is verbose on this.
        --------------------------------------------------
        A recommended way of using a custom cell factory is documented for ComboBox at:
        https://openjfx.io/javadoc/18/javafx.controls/javafx/scene/control/ComboBox.html

        Specifically, see the section titled "A warning about inserting Nodes into the ComboBox items list", which is accompanied by a code snippet showing a
        best practice:

        "Putting nodes into the items list is strongly not recommended.
        --------------------------------------------------


        This bug is to update documentation to articulate this recommendation for other Virtualized controls such as ListView, TableView, and TreeTableView.

              aghaisas Ajit Ghaisas
              aghaisas Ajit Ghaisas
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: