Description
Validate by separating comma (or custom separator) separated values (CSV) and validating them individually with a given validator
API
validatorId | org.apache.myfaces.validator.csv |
validator-class | org.apache.myfaces.custom.csvvalidator.CSVValidator |
tag-class | org.apache.myfaces.custom.csvvalidator.ValidateCSVTag |
Usage
<f:verbatim>enter credit card numbers, separated by a period:</f:verbatim> <h:inputText id="creditCardNumber" value="#{backingBean.creditCardNumbers}" required="true"> <s:validateCSV subvalidatorId="org.apache.myfaces.validator.CreditCard" separator="\\." /> </h:inputText>
Instructions
Use this validator to allow users to enter multiple input values in a single input, separated by a comma, semicolon, or other custom separator. The CSVValidator will separate the input values and call the subvalidator for each of those values.
See "myfaces-example-sandbox/validatecsv.jsp" for an example.