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
New Developer
Posts: 17
Registered: ‎10-17-2011
My Device: 9700
My Carrier: 9700
Accepted Solution

Custom ActiveTextHandler: handle #hashtag and @mention in Label

Hi all,

In Label control, can we make a custom text handler?

Example: i want to handle "#somehashtag" or "@someuser" when got tapped by user.

 

Currently, if i using standart ActiveTextHandler, only html tag like "http" would be get actions.

 

Thanks.

 

 

Highlighted
Developer
Posts: 103
Registered: ‎12-31-2012
My Device: Blackberry 9810
My Carrier: Verizon

Re: Custom ActiveTextHandler: handle #hashtag and @mention in Label

Hi

 

I doubt if there is anything like a CustomTextHandler apart from an ActiveTextHandler. I feel what you can do to near proximity is create a custom Label in CPP and handle its onTouch to check if the text it has contains your required tag.

 

_Dishooom

 

Hope this helps

New Developer
Posts: 17
Registered: ‎10-17-2011
My Device: 9700
My Carrier: 9700

Re: Custom ActiveTextHandler: handle #hashtag and @mention in Label

Its exist @dishoom. I have BB Z10, twitter application have this functionality.

And if in my application, in label using ActiveTextHandler, whenever there is "@mention" or "#hashtags" the twitter apps can listen and automaticly search for user (@mention) or hashtag.

 

and in blackberry java development this can be achieve using PatternRepository.

Developer
Posts: 103
Registered: ‎12-31-2012
My Device: Blackberry 9810
My Carrier: Verizon

Re: Custom ActiveTextHandler: handle #hashtag and @mention in Label

[ Edited ]

yippee.... Smiley Happy I think this should work ....

 

    Label {
            text: "<html><a href=\"www.w3schools.com;\">Visit W3Schools</a></html>"
            verticalAlignment: VerticalAlignment.Center
            horizontalAlignment: HorizontalAlignment.Center

            activeTextHandler: ActiveTextHandler {
                onTriggered: {          
                   console.log("Seems to work fine"+event.text);
                }
                
            }
        }

 I have used HTML in the Label text....

activeTextHandler can be used for handling the clicked event...

 

 Note: I havnt gone ahead handling the click... I have just verified it with the logs.... if i m able to get the event.text.

-Dishooom

Contributor
Posts: 16
Registered: ‎06-06-2011
My Device: 8520
My Carrier: developer

Re: Custom ActiveTextHandler: handle #hashtag and @mention in Label

are you already got this solution ? could you tell me, how it works?