File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Does anyone have any pre-built tags to validate contact info fields (e.g. phone, email, state ...) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Does anyone have any pre-built tags to validate contact info fields (e.g. phone, email, state ...)" Watch "Does anyone have any pre-built tags to validate contact info fields (e.g. phone, email, state ...)" New topic
Author

Does anyone have any pre-built tags to validate contact info fields (e.g. phone, email, state ...)

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Hi,

I'm using MyFaces 1.1.9. Can anyone point me to or share sample code that you have that creates a JSF text field for a US phone number and an email address that also validates those fields are of the right form (in the case of the phone number, I'm looking for the format "XXX-XXX-XXXX")?

Thanks, - Dave
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

Check out some of the extensions tagsets like MyFaces Tomahawk and RichFaces.

Another alternative is the MyFaces Extensions Validator, which allows you to define validations in the backing bean or on the datamodel. The datamodel option has the advantage of enforcing validation going to the database regardless of where the data came from, UI or not.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Does anyone have any pre-built tags to validate contact info fields (e.g. phone, email, state ...)