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

[ListView] Setting the items of a ListView fires selection event

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Cannot Reproduce
    • Affects Version/s: 8u40
    • Fix Version/s: 8u40
    • Component/s: javafx
    • Labels:

      Description

      This change of behaviour completely breaks the dynamic of my application.
      I am calling: classesList.setItems(FXCollections.observableArrayList(allClasses));
      this fire a selection change event.
      It seems related to a fix done recently: RT-38517

      The stack extract that fires the selection:

      at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:182)
      at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
      at javafx.beans.property.ReadOnlyObjectWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyObjectWrapper.java:176)
      at javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:142)
      at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
      at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146)
      at javafx.scene.control.SelectionModel.setSelectedItem(SelectionModel.java:102)
      at javafx.scene.control.MultipleSelectionModelBase.lambda$new$34(MultipleSelectionModelBase.java:67)
      at javafx.scene.control.MultipleSelectionModelBase$$Lambda$78/1602764176.invalidated(Unknown Source)
      at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:137)
      at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
      at javafx.beans.property.ReadOnlyIntegerWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyIntegerWrapper.java:176)
      at javafx.beans.property.ReadOnlyIntegerWrapper.fireValueChangedEvent(ReadOnlyIntegerWrapper.java:142)
      at javafx.beans.property.IntegerPropertyBase.markInvalid(IntegerPropertyBase.java:113)
      at javafx.beans.property.IntegerPropertyBase.set(IntegerPropertyBase.java:147)
      at javafx.scene.control.SelectionModel.setSelectedIndex(SelectionModel.java:68)
      at javafx.scene.control.MultipleSelectionModelBase.select(MultipleSelectionModelBase.java:357)
      at javafx.scene.control.ListView$ListViewBitSetSelectionModel.updateDefaultSelection(ListView.java:1490)
      at javafx.scene.control.ListView$ListViewBitSetSelectionModel.updateItemsObserver(ListView.java:1469)
      at javafx.scene.control.ListView$ListViewBitSetSelectionModel.access$000(ListView.java:1200)
      at javafx.scene.control.ListView$1.invalidated(ListView.java:446)
      at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:111)
      at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146)
      at javafx.scene.control.ListView.setItems(ListView.java:414)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jgiles Jonathan Giles
              Reporter:
              jfdenise Jean-Francois Denise (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported: