Search in sources :

Example 1 with LongValidator

use of org.activiti.explorer.ui.validator.LongValidator in project Activiti by Activiti.

the class LongFormPropertyRenderer 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 LongValidator("Value must be a long"));
    textField.setImmediate(true);
    return textField;
}
Also used : TextField(com.vaadin.ui.TextField) LongValidator(org.activiti.explorer.ui.validator.LongValidator)

Aggregations

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