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

Selection bar in ListView not always displayed for a selected item

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • javafx
    • win7 java 8 b89

      Under certain circumstances, when you remove an item from the list the selected item is not correctly highlighted with a selection bar even though the underlying selection model knows that an item is selected.

      This forum thread: https://forums.oracle.com/forums/thread.jspa?threadID=2534956 "Selection change event not fired" is related to this issue.

      To reproduce:

      1. Run the supplied sample code.
      2. Select the first item in the list (apples).
      3. Press the "Remove Selected" button.
      4. App will display => "Removed apples", "Selection changed from 'apples' to 'oranges'"
      5. Even though oranges are selected, there is no selection bar displayed for that item in the ListView.

      To see how the selection bar should behave:

      1. Press the "Reset List" button.
      2. Click on the second item in the list (oranges).
      3. Press the "Remove Selected" button.
      4. App will display => "Removed oranges", "Selection changed from 'oranges' to 'peaches'"
      5. Peaches are selected and there is a gray selection bar displayed for that item in the ListView.

      So the behaviour is different depending on whether you are manipulating the first item in the list or subsequent items.

            jgiles Jonathan Giles
            josmithjfx John Smith (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: