Class StringValidator

  • All Implemented Interfaces:
    Serializable, IComponentAwareEventSink, IComponentAwareHeaderContributor, org.apache.wicket.util.io.IClusterable, IValidator<String>

    public class StringValidator
    extends AbstractRangeValidator<Integer,​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

    Author:
    igor
    See Also:
    Serialized Form