textField.add(StringValidator.maximumLength(maxLengthFacet.value()));
}
}
private void addObjectAdapterValidator() {
final ScalarModel scalarModel = getModel();
final TextField<String> textField = getTextField();
textField.add(new IValidator<String>() {
private static final long serialVersionUID = 1L;
@Override
public void validate(final IValidatable<String> validatable) {
final String proposedValue = validatable.getValue();
final String reasonIfAny = scalarModel.parseAndValidate(proposedValue);
if (reasonIfAny != null) {
final ValidationError error = new ValidationError();
error.setMessage(reasonIfAny);
validatable.error(error);
}