| Author |
Mask - Format Record List Telephone Column
|
Lynn Paustian
Greenhorn
Joined: Sep 12, 2006
Posts: 2
|
|
I have a JSF page with a records list. One of the columns is telephone. I want to mask it with hyphens at the usual breaks. Some of the phone numbers are 7 characters and others are ten. I'm using RAD to create my faces pages. RAD will format for 7 or 10 but not both. Is there a way to get the length of the telephone for the column in each row and in turn use the appropriate mask? I've hunted IBM's site without any luck. I've got to believe there is a nice cheat sheet for reformating record list and records. If you know of a source I'd like to get it. Thanks in advance.
|
 |
Saurabh Chandra
Greenhorn
Joined: Feb 28, 2008
Posts: 2
|
|
Dear Lynn, Did you get any solution for that??
Originally posted by Lynn Paustian: I have a JSF page with a records list. One of the columns is telephone. I want to mask it with hyphens at the usual breaks. Some of the phone numbers are 7 characters and others are ten. I'm using RAD to create my faces pages. RAD will format for 7 or 10 but not both. Is there a way to get the length of the telephone for the column in each row and in turn use the appropriate mask? I've hunted IBM's site without any luck. I've got to believe there is a nice cheat sheet for reformating record list and records. If you know of a source I'd like to get it. Thanks in advance.
|
 |
Marcelo Rodriguez
Greenhorn
Joined: Feb 28, 2008
Posts: 6
|
|
Try this: Pattern p = Pattern.compile("\\d{1,2}-\\d{3,5}-\\d{34}-[0-9xX]{1}"); try to format in this pattern... I haven't tested 'cause I'm trying to use this as a Matcher to validate Strings. remember to change the parameters, study the sintax and Good Luck!
|
- The powerfull men can destroy one rose or two, they can even destroy the Spring (and Struts), but they will never defeat Java Server Faces (Only Tapestry can do that...) - 'Ctrl+C, Ctrl+V of Che Guevara Quote, with cH4n6Es'
|
 |
 |
|
|
subject: Mask - Format Record List Telephone Column
|
|
|