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

[ComboBox] Edit results are not saved, when ENTER is pressed.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • fx2.1
    • fx2.1
    • javafx
    • 2.1.0b02.

    Description

      I first open comboBox and found, that if I edited content of combo box and pressed enter, initial text (i mean, initially selected item) returned.

      This issue can be dublicate of RT-18179.

      import com.javafx.preview.control.ComboBox;
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.layout.Pane;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      /**
       * @author Alexander Kirov
       */
      public class Issue1 extends Application {
          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(Stage stage) throws Exception {
              Pane pane = new Pane();
              pane.setPrefHeight(200);
              pane.setPrefWidth(200);

              ComboBox cb = new ComboBox();
              cb.setEditable(true);
              
              cb.getItems().addAll("0000", "1111", "2222", "3333");

              pane.getChildren().add(cb);

              VBox vb = new VBox();
              vb.getChildren().addAll(pane);
              Scene scene = new Scene(vb, 400, 400);
              stage.setScene(scene);
              stage.show();
          }
      }

      Steps to reproduce:
      1. select any item from dropDown
      2. try to edit content in comboBox.
      3. press Enter.

      (I don't know is it proper behavior or not, but saving editing result on enter is very intuitive)

      Attachments

        Activity

          People

            jgiles Jonathan Giles
            akirov Alexander Kirov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: