You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Lance Frohman (JIRA)" <de...@myfaces.apache.org> on 2006/03/08 02:54:39 UTC

[jira] Updated: (TOMAHAWK-182) new validator - validate comma separated entries by splitting them and validating individually

     [ http://issues.apache.org/jira/browse/TOMAHAWK-182?page=all ]

Lance Frohman updated TOMAHAWK-182:
-----------------------------------


> new validator - validate comma separated entries by splitting them and validating individually
> ----------------------------------------------------------------------------------------------
>
>          Key: TOMAHAWK-182
>          URL: http://issues.apache.org/jira/browse/TOMAHAWK-182
>      Project: MyFaces Tomahawk
>         Type: New Feature
>   Components: Validators
>     Versions: 1.1.2-SNAPSHOT
>     Reporter: Lance Frohman
>     Priority: Minor
>      Fix For: 1.1.2-SNAPSHOT
>  Attachments: CSVValidator.java, CSVValidatorTag.java, faces-config.xml, messages.properties, taglib.tld
>
> I created a new validator, I needed to validate comma separated email addresses
> entered in a single text box, but I generalized it. This validator will validate the entry (must be a String)
> by first separating by a separator (parameter - defaults to ","), and then validating
> each separated sub string using the subvalidator (parameter). The error messages
> (if any) are accumulated into one. The only problem is that you can not pass parameters to the
> sub validator, so it will only work on subvalidators with no parameters or with defaults for all parameters.
> parameters:
> separator - regular expression to use for separating the input String (default is comma)
> subvalidatorId - the id of the validator to be used on each substring
> example (to validate semicolon separated credit card numbers):
>    <h:inputText id="credit_cards" value="#{testHandler.creditCards}">
>       <t:csvalid subvalidatorId="org.apache.myfaces.validator.CreditCard" separator=";"/>
>    </h:inputText>
> PLEASE email me at lfrohman@gmail.com if there is a problem, or if you have any questions. 
> Thank you.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira