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

Native Development

Reply
Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified
Accepted Solution

How to make a phone number 'active' in TextArea?

[ Edited ]

I am testing in the 10.1 and 10.2 Simulators, using the following QML.  What I am trying to figure out is what "rules" the TextArea uses to define active text, specifically phone numbers.  All I am trying to do is put a phone number in the TextArea that will give my users the chance to click on it to phone.  But I can't get it to work, or more accurately, can't get the phone number to become active.  .

 

As you will see I have tried a variety of number formats, some UK specific since I was worried that it might be using country specific recognition, but nothing i try works.

 

By contrast the address that I am also putting in the TextArea is 'hot' and starts the map.

 

FYI, the customer will be running this in Canada on Q10s using 10.1.  Also the numbers are completely fictitious, if they actually work, then that is just luck. 

 

                TextArea {
                    inputMode: TextAreaInputMode.Text
                    editable: false
                    content.flags: TextContentFlag.ActiveText
                    text: "#123 1234, #123-1234  ph: 780-784-1231. ph: (403)218-1248. ph: 403-242-1231. ph: (01637)123456. 81 Street NE, # 101 ,, Calgary. "
                }

 

I have seen this:

http://supportforums.blackberry.com/t5/Native-Development/TextArea-showing-quot-phone-numbers-quot/m...

I was expecting that I did not need to set the attributes of the TextArea using C. 

 

And I do have phone permissions - eslewhere in the app I detect when the user is on the phone. 

 

Any ideas on how I could get a phone number in a TextArea to be active, would be appreciated. 

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: How to make a phone number 'active' in TextArea?

Peter, does this Twitter conversation answer your question?

https://twitter.com/peter9477/status/382887175357874176

Basically if you have no SIM installed, the numbers won't be highlighted. Seems as though that may affect the simulator as well as Dev Alphas.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to make a phone number 'active' in TextArea?

Wow, that was fast, remind me not to have a gun fight with you 'quick draw'!

 

I wondered about this, but then the SImualtor can make phone calls.  I will try on device and let you know. 

Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to make a phone number 'active' in TextArea?

Same result on device.  Address is a hot link and takes me into maps, none of the other numbers are. 

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: How to make a phone number 'active' in TextArea?

Well, for what it's worth here's what I get with your data:

peter_strange.png


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to make a phone number 'active' in TextArea?

Thanks obviously something I am doing.  Can I ask what Build level and OS level you are using?

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: How to make a phone number 'active' in TextArea?

I'm testing on a Z10 with 10.1.0.4181, with an app targeting platformVersion 10.1.0.0 and packaged with the 10.2 NDK and a makefile that claims to be using target_10_2_0_1155.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: How to make a phone number 'active' in TextArea?

Also we're not even using the phone permission, since the active-text dialing doesn't require it, so don't bother looking into that area as the source of the issue.

The Label involved has "content.flags: TextContentFlag.ActiveText" to force that on, just in case.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to make a phone number 'active' in TextArea?

I'm running on Z10 with same build, but 10.1 NDk, building for 10.1.0.1483.  I will try another build level and see if that makes any difference. 

Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to make a phone number 'active' in TextArea?

[ Edited ]

Made no difference, but it has to be something in my system.  I'll keep looking.  Thanks for your help.