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
My Carrier: None
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)

Please use plain text.
BlackBerry Development Advisor (Retired)
rtse
Posts: 5
Registered: ‎07-26-2011
My Device: 9800
My Carrier: Rogers

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.
Please use plain text.
Contributor
rbork
Posts: 28
Registered: ‎06-10-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: None

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.

Please use plain text.
New Contributor
bkoms
Posts: 8
Registered: ‎09-27-2012
My Device: Dev Alpha
My Carrier: fido

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
Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,546
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

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.
Please use plain text.
Contributor
rbork
Posts: 28
Registered: ‎06-10-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: None

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:

 

Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,546
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

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.
Please use plain text.
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:
Please use plain text.
Contributor
rbork
Posts: 28
Registered: ‎06-10-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: None

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".

Please use plain text.
Contributor
rbork
Posts: 28
Registered: ‎06-10-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: None

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.

Please use plain text.