I know this is an old post, but I think there is a better solution (at least in later versions of SmartGWT). So, this applies to everyone who is interested in:
You can get the whole record to be checked with getRecord(). And then you can get any field value by simply requesting the attributes of the record:
CustomValidator validator = new CustomValidator() {
@Override
protected boolean condition(Object rawValue) {
Record validatedRecord = getRecord();
String field1 = validatedRecord.getAttribute(FIELD1_NAME);
String field2 = validatedRecord.getAttribute(FIELD2_NAME);
return field2 <= field1;
}
}
This is better because you do not need to keep links to your fields.
source
share