Is it a issue or am I doing something wrong?
I open an InputDialog with a DatePicker to select a date, but the dialog returns a Date type value instead of LocalDate.
dialogs.createInputDialog(this)
.withHeader("Input dialog")
.withParameters(
InputParameter.parameter("passedDate")
.withRequired(true)
.withDatatype(datatypeRegistry.get(LocalDate.class))
.withField(() -> {
TypedDatePicker<LocalDate> datePicker = uiComponents.create(TypedDatePicker.class);
datePicker.setValue(LocalDate.now());
return datePicker;
})
).withActions(DialogActions.OK_CANCEL)
.withCloseListener(closeEvent -> {
if (closeEvent.getCloseAction().equals(InputDialog.INPUT_DIALOG_OK_ACTION)) {
Object passedDate = closeEvent.getValue("passedDate");
if ( ! (passedDate instanceof LocalDate) ) {
log.info("Passed date has {} class , must be LocalDate", passedDate.getClass().getName());
}
}
}).open();