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
MRT502
Posts: 24
Registered: ‎03-19-2010
My Device: BB Z10
My Carrier: Vodafone UK

Dialog not displaying - throws error

Hi,

 

I have a Webworks app using HTML 5 and JavaScript written for the BB10 platform.

 

When running on the simulator here, the dialog displays.  When going through AppWorld testing, it just throws the following error:

 

Exception in stdDialog:

ReferenceError: Can't find variable:

blackberry

 

I have:

 

feature id="blackberry.ui.dialog" required="true"

 

in my config.xml

 

and the dialog is called with:

 

blackberry.ui.dialog.standardAskAsync(msg, blackberry.ui.dialog.D_OK, emptyPH, { title : title })
 

Any clues/ideas/help...?

 

Cheers.

Please use plain text.
Retired
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10

Re: Dialog not displaying - throws error

Are you including webworks.js after dom content loaded and waiting for "webworksready" event to be fired?

 

It sounds like your application cannot access the APIs.

 

More info here:

 

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

 

Best way to include the webworks.js file is like this:

 

 

 
@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Retired
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10

Re: Dialog not displaying - throws error

<script src="local:///chrome/webworks.js" type="text/javascript"></script>
@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Contributor
MRT502
Posts: 24
Registered: ‎03-19-2010
My Device: BB Z10
My Carrier: Vodafone UK

Re: Dialog not displaying - throws error

I have the webworks.js included between the "<head></head>" tags and the document.addEventListener("webworksready", functionee() { }) straight after the <body> tag.

Is this not correct?
Please use plain text.