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

Web and WebWorks Development

Reply
New Contributor
jmtk
Posts: 4
Registered: ‎09-11-2012
My Device: Playbook
My Carrier: Verizon
Accepted Solution

Two Quick Questions

I'm writing an HTML/JavaScript app and would like to port it to the Playbook. My first question is how to replicate making a call to window.open(url) to open a web page on the Playbook.

 

I would also like to know how to gain access to blackberry.system in my JavaScript code. Is this just automatically available when my app is run on the Playbook? I could test these things much more easily if I had an actual Playbook, but alas I do not. So I shall ask here :smileyhappy:

 

Thanks.

Please use plain text.
Developer
billbsb
Posts: 142
Registered: ‎03-25-2011
My Device: Playbook, Z10 L.E.
My Carrier: Vodafone NL

Re: Two Quick Questions

Hi jmtk,

 

1) You could try using the Invoke API

function openWebLinkInBrowser() {
    // open web link in browser
    blackberry.invoke.invoke({
        target: "sys.browser",
        uri: "http://www.blackberry.com"
    }, onInvokeSuccess, onInvokeError);
}

2) You need to change the app's configuration file and add the appropriate permitions.

 

Cheers!

Cheers!
Please use plain text.
New Contributor
jmtk
Posts: 4
Registered: ‎09-11-2012
My Device: Playbook
My Carrier: Verizon

Re: Two Quick Questions

Thanks for the info.

To use either of those you'll need the following in your config file:

<feature id='blackberry.system'/>
<feature id='blackberry.invoke'/>
Please use plain text.