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
Retired
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: BB10 external links not working

Sure, send away. erjohnson@rim.com is good. You can send me the zip, and or the bar, if you send the bar please package it with -d so I can see what's happening.

@erikjohnzon
erjohnson@blackberry.com
Developer
Posts: 222
Registered: ‎03-03-2012
My Device: Ripple, LE Z10, Dev Alpha _C, Playbook, Bold 9900
My Carrier: rogers

Re: BB10 external links not working

sdk/bin/blackberry-deploy -installapp -password 1234 -device 169.254.0.1 -package c:\sandbox2\device\sitemanager.bar

 

where does the '-d' go in the above

Retired
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: BB10 external links not working

During your packaging phase when executing ./bbwp sitemanager.zip -d.

 

The -d option will enable web inspector on port 1337.

@erikjohnzon
erjohnson@blackberry.com
Highlighted
Developer
Posts: 222
Registered: ‎03-03-2012
My Device: Ripple, LE Z10, Dev Alpha _C, Playbook, Bold 9900
My Carrier: rogers

Re: BB10 external links not working

file sent at 8.40 pmSmiley Very Happy

Retired
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: BB10 external links not working

Hi Bob,

 

I had a look at your app, you were pretty close to getting it right but here are a couple suggestions that should make things work. I re-packaged it myself and it worked fine with the changes below:

 

1. When whitelisting a domain, you don't need to append the actual path on the server so it's preffered to use this: <access uri="http://brooklynn.ky" subdomains="true" /> please add this and remove the trailing "/sitemanager" as well as the closing brance that encloses the feature elements, this is not needed.

 

 

2. You are attempting to invoke the browser using the target =_blank this is not yet supported but will be out in the next release Rel 10. You can follow the conversation here: https://github.com/blackberry/BB10-WebWorks-Framework/issues/230.

 

3. To accomplish what you want in the meantime you should REMOVE the following code:

//register ready event after window has loaded
window.addEventListener("load", function (e) {
document.addEventListener("webworksready", ready)
}, false);

 

4. You should now add a click handler to your <li><a>Control Center</a></li> such that when clicked it will call the openWebLinkInBrowser() function. You are never calling it, but if you would, it would invoke properly.

 

5. Compile your app with the -d flag and use web inspector it is available in development mode as <device-ip>:1337. It will provide you with lots of usefull information to debug with.

 

I hope that helps. I as able to get it working no problem for myself, so give it a shot. Nice app by the way Smiley Happy.

@erikjohnzon
erjohnson@blackberry.com
Developer
Posts: 222
Registered: ‎03-03-2012
My Device: Ripple, LE Z10, Dev Alpha _C, Playbook, Bold 9900
My Carrier: rogers

Re: BB10 external links not working

Eric,

at last gold.danke schoenSmiley Very Happy

I need to better understand how BB10 calls on it's own javascripts.

Question: regarding placement of the javascripts.

Is it better to place scripts in <head> section? or after last <div> before closing </body>?

Retired
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: BB10 external links not working

Where you put your scripts will be very similar to how you would want to optimize a page on the normal web. The "webworks ready" event is to be used to kick-off your scripts that require use of the API. The reason I did not add the webworks ready for you, is that you are calling it on click from a user, and not onload.

 

Refer to the documentation at this link for more information on webworks ready:

 

https://developer.blackberry.com/html5/documentation/creating_a_bb10_app_2007539_11.html

 

function ready() {

         var ele = document.createElement("div");
         ele.innerHTML = "uuid: " + blackberry.identity.uuid;
         document.documentElement.appendChild(ele);
      }
      window.addEventListener("load", function(e) {
         document.addEventListener("webworksready", ready);
      }, false);

 

For general loading information for performance please see the following:

http://developer.yahoo.com/performance/rules.html#postload

 

If your situation was resolved, please mark the thread as resolved! Thanks! Any further help you need just let me know you have my email Smiley Happy.

@erikjohnzon
erjohnson@blackberry.com