public interface RowValidator
extends java.util.EventListener
Validator
is an interface for validating a row in table.Modifier and Type | Method and Description |
---|---|
ValidationResult |
validating(RowValidationObject vo)
Validates the value in the RowValidationObject.
|
ValidationResult validating(RowValidationObject vo)
ValidationResult
allows user to specify the fail behavior such as FAIL_BEHAVIOR_REVERT,
FAIL_BEHAVIOR_RESET or FAIL_BEHAVIOR_PERSIST, in the case of RowValidator, none of the options make sense so the
fail behavior you set will be ignored. So it is better you process the error right there in the validating
method. See the code below for an example.
public ValidationResult validating(RowValidationObject vo) {
boolean valid = ...; // validate the row
if (valid) {
return null;
}
else {
PortingUtils.notifyUser(); // notify the user
table.editCellAt(vo.getRowIndex(), 5); // force editing mode in case this is the invalid cell.
return new RowValidationResult(false, new int[]{5});
}
}
Please note all the RowValidators added to a JideTable will be used for to validate any rows.vo
- the ValidationObject