01-16-2013 07:46 PM
Hi
I am making an app that can show comments that people have submitted - I'd like to be able to allow the the user to click on a link in the comments and either open the browser or a webview to that link.
Is this possible? I've tried searching but I'm not sure on the wording of my request.
01-17-2013 05:17 AM
Implement the onTouch event for Label and pass the url to webview in event.isUp() method
onTouch: {
if (event.isUp()) {
webview_id.url = url
webvbiew.visible = true
}
if (event.isDown() || event.isMove()) {
//display focus
} else {
//undisplay focus
}
}
Find the more information about webview here
https://developer.blackberry.com/cascades/referenc
01-17-2013 05:33 AM
I haven't tried it but if you are using a control that can use a TextStyleDefintion then you can format the text as HTML and since it has the <a> attribute I would surmise it would open a browser, info here...
https://developer.blackberry.com/cascades/document
01-17-2013 11:07 AM
If you use a TextArea (and if you want it to look like a Label, turn editable to false) hyperlinks will be "clickable" and open in the native browser.
01-17-2013 02:08 PM
Most easy way is following:
Label {
text: qsTr("Plese don't hesitate to provide feedback at http://blackberry.hubalek.net")
multiline: true
content.flags: TextContentFlag.ActiveText
}
content.flags: TextContentFlag.ActiveText does the trick.
If you like my solution please accept my response