Here is the found case, with two simple InlineDateFields in the application I want the second calendar to react on a value change event of the first calendar.
here is the simple code:
@Override
public void init() {
final Window mainWindow = new Window("Inlinedatefieldproblem Application");
Label label = new Label("Is this working ? selecting a date from inlineDateField1 should change inlineDateField2 ");
mainWindow.addComponent(label);
final InlineDateField inlineDateField1 = new InlineDateField();
inlineDateField1.setResolution(InlineDateField.RESOLUTION_DAY);
inlineDateField1.setImmediate(true);
inlineDateField1.setValue(new Date());
mainWindow.addComponent(inlineDateField1);
final InlineDateField inlineDateField2 = new InlineDateField();
inlineDateField2.setResolution(InlineDateField.RESOLUTION_DAY);
inlineDateField2.setImmediate(true);
inlineDateField2.setValue(new Date());
mainWindow.addComponent(inlineDateField2);
inlineDateField1.addListener(new Property.ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
mainWindow.showNotification("new value " + event.getProperty().getValue());
inlineDateField2.setValue((Date)event.getProperty().getValue());
}
});
setMainWindow(mainWindow);
}
and then if you run this, when on the same month date change seems to work juste fine, if selecting a date in another month, the refresh of the second InlineDateField seems to be done incorrectly (i.e. the month is not changed in the second calendar).
is there something missing in this piece of code or is this a bug ?
thanks in advance for the feedback
Eric.