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

ListView: Replacing all items does not clear selection

XMLWordPrintable

      I am able to reproduce this scenario consistently:

      1. System adds 5 cows to a ListView
      2. The user picks cow number 2.
      3. System decides it is not time to show pigs in the ListView instead of cows and invokes myObservableItemList.setAll(listOfPigs) to completely replace all cows with pigs.
      4. Much to the user's surprise pig number 2 is now selected automatically.

      I think this is a bug: If I invoke setAll on the observable list containing the items of the list view, I believe ListView should automatically clear its selection model's selected item. Since the list contents are replaced with completely different content, there cannot be any selection yet, until the system explicitly selects it.

            jgiles Jonathan Giles
            risaksen Randahl Isaksen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: