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

[ComboBox] ComboBox: can't null selectedItem

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u20, 8u40
    • Fix Version/s: 8u40
    • Component/s: javafx
    • Environment:

      current ea 8u40b7

      Description

      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);

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported: