Monday, February 28, 2011

DateBox : Null value not identified

I have to do mandatory check for a date fieldWhen the user doesn't any
date in the datebox input

final DateBox dateBox = new DateBox();
dateBox.setValue(new Date());

//capture the change event of date picker
dateBox.addValueChangeHandler(new ValueChangeHandler<Date>() {
public void onValueChange(final ValueChangeEvent<Date> event) {
if (event.getValue() == null) {
Window.alert("Date cannot be null");
validationFailed = true;
} }

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment