12-08-2012 06:52 AM
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/referenc
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
Solved! Go to Solution.
12-10-2012 08:08 AM
12-17-2012 09:22 AM
Finally I found a workaround, you need to register the handler:
qmlRegisterType<ActiveTextHandler>("bb.cascades.ac tivetexthandler", 1, 0, "ActiveTextHandler");
qmlRegisterUncreatableType<ActiveTextTriggeredEven t>("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
01-15-2013 07:15 PM
You just saved me a ton of time, contryboy, thanks! Your solution worked perfectly.
03-23-2013 11:51 AM
Great ! Saved my time as well. Thanks man.
03-24-2013 12:40 AM
Thanks. It worked for me as well.