use of org.activiti.explorer.ui.validator.DoubleValidator in project Activiti by Activiti.
the class DoubleFormPropertyRenderer method getPropertyField.
@Override
public Field getPropertyField(FormProperty formProperty) {
final TextField textField = new TextField(getPropertyLabel(formProperty));
textField.setRequired(formProperty.isRequired());
textField.setEnabled(formProperty.isWritable());
textField.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty)));
if (formProperty.getValue() != null) {
textField.setValue(formProperty.getValue());
}
// Add validation of numeric value
textField.addValidator(new DoubleValidator("Value must be a double"));
textField.setImmediate(true);
return textField;
}
Aggregations