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

[ComboBox] ComboBox: can't null selectedItem

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8u40
    • 8u20, 8u40
    • javafx
    • current ea 8u40b7

      Happens if the items had been set on-the-fly when opening the popup. To reproduce, use example in RT-22572 , add a button that null the selectedItem and run the following steps

      - sanity check: click nullSelected - combo is cleared, as expected
      - open popup
      - select item from popup
      - click nullSelected
      - expected: combo cleared
      - actual: combo still showing the last selected

      Seem like a missing value update (selectedItem is null)

       Code snippet to insert:

              Button nullSelected = new Button("Null selectedItem");
              nullSelected.setOnAction(e -> {
                  cb.getSelectionModel().select(null);
              });
              ... // add to view
              vbox.getChildren().addAll(tf, cb, nullSelected);

            jgiles Jonathan Giles
            fastegal Jeanette Winzenburg
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: