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
rbork
Posts: 28
Registered: ‎06-10-2012
My Device: Blackberry 10 Dev Alpha
Accepted Solution

ReferenceError: Can't find variable blackberry

I created and installed the helloworld webworks application, described in the Webworks documentation,
"Creating Helloworld for Blackberry 10".  When run "Web Inspector" indicates "ReferenceError: Can't find variable blackberry" for the code line:

ele.innerHTML = "uuid: " + blackberry.identity.uuid

 

(Not sure if its relevant but my BB10 Alpha device was upgraded to the new OS at Blackberry Jam)

Retired
rtse
Posts: 5
Registered: ‎07-26-2011
My Device: 9800

Re: ReferenceError: Can't find variable blackberry

Have you included the webworks.js file (in the Framework/clientFiles folder)? You have to reference it in your html file and make sure you include it in your app zip file.
Contributor
rbork
Posts: 28
Registered: ‎06-10-2012
My Device: Blackberry 10 Dev Alpha

Re: ReferenceError: Can't find variable blackberry

Yes I did include "webworks-1.0.0.15.js". I have it in the root of the project with index.html. Its in the zip file thats published to the output folder. I don't understand whats wrong.

New Contributor
bkoms
Posts: 8
Registered: ‎09-27-2012
My Device: Dev Alpha

Re: ReferenceError: Can't find variable blackberry

the newest update for webworks is 1.0.2.9. Try updating to that, and include the newest webworks.js
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: ReferenceError: Can't find variable blackberry

Ditto what bkoms said. Also, can you confirm that you are waiting for the webworksready event before attempting to access the blackberry object?


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Contributor
rbork
Posts: 28
Registered: ‎06-10-2012
My Device: Blackberry 10 Dev Alpha

Re: ReferenceError: Can't find variable blackberry

Great. Now blackberry is not null. :Yes:

blackberry is not null

blackberry.identity is not null

blackberry.identity.uuid is NULL :Helpsmilie:

 

BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: ReferenceError: Can't find variable blackberry

Just to confirm, you copied the new webworks.js file from the 1.0.2.9 SDK's clientFiles folder in place of the old file?


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: ReferenceError: Can't find variable blackberry

Does it work that way?

Did it work before the update?

 

The documentation referring to identity for bb10 doesn't have any code like yours:

https://developer.blackberry.com/html5/apis/blackberry.identity.html#.uuid

 

The BBM platform documentation refers to uuid but again in a different way.  Could you share with us under which context you are using the uuid?

If it helped you, click like. :smileyhappy:
Contributor
rbork
Posts: 28
Registered: ‎06-10-2012
My Device: Blackberry 10 Dev Alpha

Re: ReferenceError: Can't find variable blackberry

For BB10, uuid is a static property that can be read - according to this document you refer to. Its stated in the table expanded under the link "View Supported Platform Table".

Contributor
rbork
Posts: 28
Registered: ‎06-10-2012
My Device: Blackberry 10 Dev Alpha

Re: ReferenceError: Can't find variable blackberry

Yes I did. But I'm wondering if the problem is in how the version number attribute in the feature element of the config.xml is processed. I wonder if it must match the version number in the top widget element.