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

Reply
Developer
ignites
Posts: 466
Registered: ‎04-11-2012
My Device: Bold 9900
My Carrier: Rogers

Get the url from a Webview

I have a webview with these properties

 

WebView {
id: actualView
url: "https://touch.www.linkedin.com/#home"
}

 

And I want to make my action item view the webview in browser like so:

 

 

ActionItem {
title: "View in Browser"
imageSource: "asset:///images/actionBar/newwindow.png"
ActionBar.placement: ActionBarPlacement.OnBar
onTriggered: {
invokeMoreInfo.trigger("bb.action.OPEN");
}
attachedObjects: [
Invocation {
id: invokeMoreInfo
query: InvokeQuery {
mimeType: "text/html"
uri: actualView.url();
invokeActionId: "bb.action.OPEN"
}}]

 

i tried using actualView.url() to get the url of the webview to launch in browser but it doesnt seem to work. The code works because when I input a string like "http://yahoo.com" it will launch said site. Is it possible to get the URL from a webview so that the users can view the links in a browser?

 

Thanks!


Developer for easyDial for BlackBerry Bold & inLink for BlackBerry PlayBook
Find me online via twitter, or on the techfruits.com webpage. Please hit the like button below if what I said helped!
Please use plain text.
Developer
ekke
Posts: 1,428
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Get the url from a Webview

in WebView you can add

 

onUrlChanged {}

 

where you have access to

 

url

 

perhaps this can help you ?

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: Get the url from a Webview

Url is a property and not a method, you should just be able to use actualView.url
Like all of my posts
Please use plain text.
Developer
ignites
Posts: 466
Registered: ‎04-11-2012
My Device: Bold 9900
My Carrier: Rogers

Re: Get the url from a Webview


kylefowler wrote:
Url is a property and not a method, you should just be able to use actualView.url

I tried that too - thats actually what i tried at first 


Developer for easyDial for BlackBerry Bold & inLink for BlackBerry PlayBook
Find me online via twitter, or on the techfruits.com webpage. Please hit the like button below if what I said helped!
Please use plain text.