Search in sources :

Example 1 with DoubleValidator

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;
}
Also used : DoubleValidator(org.activiti.explorer.ui.validator.DoubleValidator) TextField(com.vaadin.ui.TextField)

Aggregations

TextField (com.vaadin.ui.TextField)1 DoubleValidator (org.activiti.explorer.ui.validator.DoubleValidator)1