CellTable FieldUpdater Validation (not null, etc)
I am using the CellTable, with the EditTextCell and the
DatePickerCell.
I'm trying to do some basic validation to control the users input. For
example
1) I'd like to prevent the user from inputting a null or empty string
in the EditTextCell
2) I have a Start and End date. And I want to make sure the user
doesn't set the End date before the Start date
finishColumn.setFieldUpdater(new FieldUpdater<Appointment, Date>() {
public void update(int index, Appointment object, Date value) {
if(object.getFinish().before(getStart()) {
Window.alert("The Appointment can
not finish before the Start date");
} else {
object.setFinish(value);
}
}
});
I'm able to prevent the incorrect finish date from being set, however,
the grid still displays the incorrect value. The object and grid are,
therefore, out of sync.
What is the recommended way to data validation within in editable
CellTable?
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home