Class StringValidator

All Implemented Interfaces:
Serializable, IComponentAwareEventSink, IComponentAwareHeaderContributor, IClusterable, IValidator<String>

Validator for checking if length of a string falls within [min,max] range. If either min or max are null they are not checked.

If the component is attached to an input tag, a maxlen attribute will be added if the maximum is set. *

Resource keys:

Error Message Variables:

  • name: the id of Component that failed
  • label: the label of the Component (either comes from FormComponent.labelModel or resource key <form-id>.<form-component-id>
  • input: the input value
  • length: the length of the entered
  • minimum: the minimum allowed length
  • maximum: the maximum allowed length

See Also: