I have a form with a DateField and I want to be able to toggle between read-only mode and non-read-only/edit mode.
When the field is initially read-only and I switch to non-read-only then the time section of the calendar isn't editable/displayed correctly.
When the field is initially non-read-only toggling between non-read-only and read-only works es expected. The problem is that the field initially needs to be read-only.
Am I missing something or is this a bug?
I'm using vaadin 7.4.4 with vaadin-spring-boot-starter-1.0.0.beta2.
@SpringUI()
@Theme("valo")
public class TestUI extends UI {
@Override
protected void init(VaadinRequest request) {
DateField dateField = new DateField();
dateField.setResolution(Resolution.MINUTE);
dateField.setValue(new Date());
dateField.setReadOnly(true);
Button button = new Button("toggle read-only");
button.addClickListener(event -> dateField.setReadOnly(!dateField.isReadOnly()));
VerticalLayout pageLayout = new VerticalLayout(dateField, button);
pageLayout.setSpacing(true);
pageLayout.setMargin(true);
setContent(pageLayout);
}
}