[DatePicker] Does not change to new selected value if modal window is shown in DatePicker-action

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8u40
    • Affects Version/s: 8u20
    • Component/s: javafx
    • Environment:

      Windows 7 64bit, JDK 8u20 Build b23

      A modal window is shown when changing the value of the DatePicker. Because of that the value of the DatePicker could not be changed.


      import java.time.LocalDate;
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.DatePicker;
      import javafx.scene.layout.VBox;
      import javafx.stage.FileChooser;
      import javafx.stage.Stage;

      public class Test extends Application {

      @Override
      public void start(Stage stage) throws Exception {
      DatePicker datePicker = new DatePicker(LocalDate.now());
      stage.setScene(new Scene(new VBox(datePicker), 300, 200));
      stage.show();

      datePicker.setOnAction(e -> {
      if (stage.isShowing()) {
      new FileChooser().showOpenDialog(stage);
      }
      });
      }

      public static void main(String[] args) {
      launch(args);
      }

      }

            Assignee:
            Martin Sládeček
            Reporter:
            Andreas Liebelt
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: