I am trying to create a form that contains a field where I can select a date and a time. This is in general possible by creating a DynamicForm and placing a DateTimeItem in it. This is working so far. However when I want to change the time portion of the fields value, the change is not reflected to the backing JS object. I created the following short snippet to demonstrate the behaviour:
Now do the following:
SmartGWT version: v11.1p_2018-01-23/LGPL Development Only
Browser: Chrome 64, Firefox 58
Code:
final DynamicForm dynamicForm = new DynamicForm(); final DateTimeItem dateTimeItem = new DateTimeItem(); final ButtonItem buttonItem = new ButtonItem(); dateTimeItem.setTitle("My clean item"); buttonItem.setTitle("Log value"); buttonItem.addClickHandler(e -> GWT.log(dateTimeItem.getValue().toString())); dynamicForm.setItems(dateTimeItem, buttonItem);
- Select a date and a time (e.g. 2018-02-21 09:00)
- Press the button (Logs 2018-02-21 09:00)
- Change the time portion either using the chooser or by manipulating the text field (e.g. 2018-02-21 10:00)
- Press the button (Logs 2018-02-21 09:00 and not 2018-02-21 10:00)
SmartGWT version: v11.1p_2018-01-23/LGPL Development Only
Browser: Chrome 64, Firefox 58
Comment