• Post Reply Bookmark Topic Watch Topic
  • New Topic

Mask - Format Record List Telephone Column  RSS feed

 
Lynn Paustian
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!