私は次のコードを使用しています。しかしaddvaluechangedHandler
、gwtで2回起動します。一度だけ発生するように、他にどのような方法を使用する必要がありますか?
calendar.addValueChangeHandler(new ValueChangeHandler<Date>() {
@Override
public void onValueChange(ValueChangeEvent<Date> event) {
Date newDate = calendar.getValue();
newDate.setDate(newDate.getDate()+1);
if ((newDate.before(todaysDate))) {
Window.alert("You can not choose past dates before " +todaysDate);
calendar.setValue(null);
}
}
});