Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
webbasan
Posts: 20
Registered: ‎04-19-2010
My Device: supporting 4.6 upwards

ActiveRichTextField: What is the expected format for phone numbers?

I'm using the ActiveRichTextField to display contact informations including postal address, telephone and telefax numbers, etc.

 

My phone numbers have the scheme +49 555 12 34 56 - 000, consisting of the international prefix, 3 (upto 5) for the area code, a "grouped for readability" phone number and the direct access number.

 

I didn't find any format description for phone numbers which is used by the ActiveRichTextField, so I did some experimentation... But the results are looking very inconsistent to me...

 

I tried this:

 

  • +49 555 12 34 56 - 000 -- direct access number not recognized as part of the phone number.
  • +49 555 12 34 56 000 -- no phone number at all.
  • +49 555 123 456 000 -- also no phone number.
  • +49555123456000 -- success! Completely recognized, but unreadable to the human eye...
  • +49-555-123456000 -- nothing...
  • +49(555)123456-000 -- still nothing...
  • +49(555)123456000 -- no prefix.
  • +4955555123456000 -- just for the fun: try 5 digits area code: won't work.
  • +49 55555 123456 - 000 -- not much of a surprise...
  • +49 555 123456000 -- again no prefix.

So, my questions are:

 

Does anybody know how this pattern matcher actually works? 

Did I miss something, is it possible to have a formatted number that is entirely recognized as a phone number?

Or is it just usable for north-american phone numbers and I have to provide my own pattern matcher etc. for the rest of the world?

 

I'm currently using version 4.5 as target device software - in case this something that is "special" for specific versions...

 

Senior Software Engineer
Lindenbaum GmbH
http://www.lindenbaum.eu/
Developer
jwargo
Posts: 395
Registered: ‎12-18-2008
My Device: BlackBerry Torch 9800

Re: ActiveRichTextField: What is the expected format for phone numbers?

There's a whole bunch of patterns defined by RIM to use for matching phone numbers in ActiveTextFields. I don't remember seeing the complete list of formats, but RIM has tried to accommodate as many formats as possible including international numbers. There's even a way to define your own patterns and handlers for your formats.

 

I wonder perhaps if you're encountering a bug.