use of org.eclipse.scout.rt.client.ui.form.fields.ValidationFailedStatus in project scout.rt by eclipse.
the class AbstractMixedSmartField method setValidationError.
private void setValidationError(String displayText, String errorMessage, int code) {
setCurrentLookupRow(null);
setDisplayText(displayText);
// remove existing validation errors first
removeErrorStatus(ValidationFailedStatus.class);
addErrorStatus(new ValidationFailedStatus(errorMessage, ValidationFailedStatus.ERROR, code));
}
use of org.eclipse.scout.rt.client.ui.form.fields.ValidationFailedStatus in project scout.rt by eclipse.
the class AbstractColumn method setValue.
protected void setValue(ITableRow r, VALUE value, boolean updateValidDisplayText) {
try {
Cell cell = r.getCellForUpdate(this);
cell.removeErrorStatus(ValidationFailedStatus.class);
VALUE newValue = validateValue(r, value);
// set newValue into the cell only if there's no error.
if (!cell.hasError()) {
r.setCellValue(getColumnIndex(), newValue);
if (this instanceof ITableRowCustomValueContributor) {
((ITableRowCustomValueContributor) this).enrichCustomValues(r, r.getCustomValues());
}
}
ensureVisibileIfInvalid(r);
if (updateValidDisplayText) {
updateDisplayText(r, newValue);
}
} catch (ProcessingException e) {
if (LOG.isDebugEnabled()) {
LOG.debug("Error setting column value ", e);
}
Cell cell = r.getCellForUpdate(this);
// add error
cell.addErrorStatus(new ValidationFailedStatus<VALUE>(e, value));
updateDisplayText(r, value);
}
}
Aggregations