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
Highlighted
Developer
Posts: 68
Registered: ‎08-16-2012
My Device: BB10 Dev Alpha
My Carrier: NA
Accepted Solution

"ActiveTextHandler is not a type" error

 

Dear Devs,

 

I am encountering a weared problem, I intend to use the active text handler to handle the click of a href in html text, the code following is quite similiar to the sample from https://developer.blackberry.com/cascades/reference/bb__cascades__activetexthandler.html, how ever, when I tried to run it, the error occurs as "

ctiveTextHandler is not a type

                activeTextHandler: ActiveTextHandler {

                                   ^) 

bb::cascades::QmlDocument:createRootObject document is not loaded or has errors, can't create root "

 

Anyone has an idea of what is wrong here? Thanks.

 

TextArea {
    id: statusTextArea
    text: "<html><a href='testurl'>test</a></html>"
    preferredWidth: 728
    inputMode: TextAreaInputMode.Text
    editable: false
    
    textStyle {
        fontSizeValue: 7
    }
    content {
        flags: TextContentFlag.ActiveText
    }
    activeTextHandler: ActiveTextHandler {
        onTriggered: {
            //do something
        }
    }
}

 Thanks,

Dong

Developer
Posts: 68
Registered: ‎08-16-2012
My Device: BB10 Dev Alpha
My Carrier: NA

Re: "ActiveTextHandler is not a type" error

Anyone has an idea of the ActiveTextHandler issue?
Developer
Posts: 68
Registered: ‎08-16-2012
My Device: BB10 Dev Alpha
My Carrier: NA

Re: "ActiveTextHandler is not a type" error

Finally I found a workaround, you need to register the handler:

qmlRegisterType<ActiveTextHandler>("bb.cascades.activetexthandler", 1, 0, "ActiveTextHandler");
qmlRegisterUncreatableType<ActiveTextTriggeredEvent>("bb.cascades.activetexthandler", 1, 0, "ActiveTextTriggeredEvent", "");

 And then import it in QML:

import bb.cascades.activetexthandler 1.0

 Then it will work as expected!

 

Cheers,

Dong

Developer
Posts: 206
Registered: ‎05-15-2012
My Device: None
My Carrier: Telus

Re: "ActiveTextHandler is not a type" error

You just saved me a ton of time, contryboy, thanks! Your solution worked perfectly.

----------------------
Check out my app, Alien Flow for reddit

And of course, like my post if you found it helpful or informative!
New Contributor
Posts: 6
Registered: ‎03-03-2013
My Device: BB10
My Carrier: Airtel

Re: "ActiveTextHandler is not a type" error

Great ! Saved my time as well. Thanks man.

Contributor
Posts: 12
Registered: ‎02-19-2013
My Device: Z10
My Carrier: 123456789

Re: "ActiveTextHandler is not a type" error

Thanks. It worked for me as well.