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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 17
Registered: ‎06-19-2013
My Device: BlackBerry Z10
My Carrier: O2
Accepted Solution

Creating html link in Label with text containing &

Hi,

 

I have a label and set it's text with a string surrounded by html and a tags and this usually works fine but if the string contains & character then it doesn't display correctly.

 

Is there a way to fix this?

Developer
Posts: 410
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: Creating html link in Label with text containing &

& is a special symbol in HTML, chek it out:

http://www.w3schools.com/tags/ref_ascii.asp

 

You have to put & instead.

Contributor
Posts: 17
Registered: ‎06-19-2013
My Device: BlackBerry Z10
My Carrier: O2

Re: Creating html link in Label with text containing &

Thanks for replying.

 

I'm trying .replace("&", "&") but & appears in the txt rather than &.

 

Any ideas?

Highlighted
Developer
Posts: 410
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: Creating html link in Label with text containing &

Could you post your QML?

I just had the same issue yesterday and it worked for me.

Contributor
Posts: 17
Registered: ‎06-19-2013
My Device: BlackBerry Z10
My Carrier: O2

Re: Creating html link in Label with text containing &

I'm returning the string back to qml from c++ to be displayed - how did you do it with qml?

Developer
Posts: 410
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: Creating html link in Label with text containing &

I also used setText() from C++, But I'd like to see the property of your Label

Contributor
Posts: 17
Registered: ‎06-19-2013
My Device: BlackBerry Z10
My Carrier: O2

Re: Creating html link in Label with text containing &

My problem was actually because my html tags were being inserted in the wrong places due to increasing number of characters when replace happens.

 

All sorted now.

 

Thanks a lot for your help.