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

One and only one MapPropertyBase<K,V> change listener works.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8u121
    • javafx
    • None
    • x86
    • windows_10

      SimpleMapProperty<String, String> map = new SimpleMapProperty<>(FXCollections.observableHashMap());

      Add several change listeners and modify the map. Nothing happens.

      Example code attached.

      Expected output:

      Map Listener 1
      Map Listener 2
      Map Listener 3
      Boolean Listener 1
      Boolean Listener 2
      Boolean Listener 3

      Actual:

      Boolean Listener 1
      Boolean Listener 2
      Boolean Listener 3

      If any 2 of 3 map listeners are commented out, remaining single listener works. All 3 boolean property listeners work fine.

      Workaround is to bind another SimpleMapProperty and add listener there. This trick works as many times as required.

            kcr Kevin Rushforth
            ppantele Petr Panteleyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: