+ "Then try to set DateField's value using the first button. It sets the value "
+ "correctly (as we can see from the Label) but the client-side is not updated.<br/>"
+ "Using second button updates value correctly on the client-side too.",
ContentMode.XML));
final PopupDateField df = new PopupDateField(dateProperty);
df.setLocale(new Locale("en", "US"));
df.setImmediate(true);
df.setResolution(DateField.RESOLUTION_DAY);
addComponent(df);
Label valueLabel = new Label(df.getPropertyDataSource());
valueLabel.setCaption("DateField's value");
addComponent(valueLabel);
final Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR, 2010);
cal.set(Calendar.MONTH, 11);
cal.set(Calendar.DAY_OF_MONTH, 14);
Button setDateButton1 = new Button(
"Set value to 12/14/10 using property", new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
dateProperty.setValue(cal.getTime());
}
});
addComponent(setDateButton1);
Button setDateButton2 = new Button(
"Set value to 12/14/10 using setValue", new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
df.setValue(cal.getTime());
}
});
addComponent(setDateButton2);
}