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
Contributor
Posts: 18
Registered: ‎02-28-2011
My Device: PlayBook, Z10
My Carrier: Bell

Issues when accessing blackberry.ui and blackberry.app.

I am trying to use the following in a playbook webworks app and seem to be having some problems with them:

 

blackberry.ui.dialog.customAsk

blackberry.ui.dialog.standardAsk

blackberry.app.version

 

I have the following in my config.xml:

 

 

  <feature id="blackberry.app" version="1.0.0"/>
  <feature id="blackberry.ui.dialog" version="1.0.0"/>

The issue that I have is that "blackberry" is undefined... but not always. I have some initialization code hooked up to the onload event of the HTML body tag. With the code running here, I find that attempting to use the blackberry.ui methods results in exceptions. But if I call them from a timer set for about 2s later, it works.

 

 

For blackberry.app.version, I know that it was working a few days ago, but it isn't today. Again, I get exceptions when trying to access it. I didn't make any kind of significant changes to the code using it, so I'm not sure why it stopped working.

 

Is there some reason why the blackberry object is not accessible when the code starts running? And if so, when can I be sure that it is accessible?

 

Thanks for any pointers. I'm new to BlackBerry development so I might be missing something basic. This is one of the last items I need to get figured out before my app is ready for submission.

 

Regards,


Wayne

 

Fisherlea Systems
www.fisherlea.com
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Issues when accessing blackberry.ui and blackberry.app.

Hi Wayne,

 

There is a known issue with Beta2 of WebWorks for PlayBook where the APIs sometimes are not available before the onload runs.

 

We should have a fix available for this available in a week or two from now.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 18
Registered: ‎02-28-2011
My Device: PlayBook, Z10
My Carrier: Bell

Re: Issues when accessing blackberry.ui and blackberry.app.

Ok. Thanks for the feedback. I thought that I was doing something strange or just going crazy.

 

In the mean time, I have worked around it by removing the calls to blackberry.ui.dialog and added a delay before accessing blackberry.app.

 

Regards,

 

Wayne

 

Fisherlea Systems
www.fisherlea.com