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
Regular Contributor
annuk
Posts: 82
Registered: ‎09-26-2012
My Device: Torch 9800
My Carrier: NA

Problem using BBUI with webwerks

Hi,

 

I am trying to use bbui-0.9.4.js with webworks-1.0.2.9.js.

 

I am not able to load index.html on my browser. I am getting the following error.

 

  1. http://localhost:8472/extensions/get/?hash=0ce47be0f0e032b04d4c4ba14e243218&version=1.0.2.9
    1. createWebworksReadywebworks-1.0.2.9.js:1194

I am using the sample code provided with BB UI.

 

Where am i going wrong.

Regards,

Annuk

Please use plain text.
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: Problem using BBUI with webwerks

[ Edited ]

Are you trying to include the webworks file in your project?  I mean you need to reference it as in the doc but it seems you have it opied to your actual project folder maybe.

 

The documentation is badly worded when it says: "You must copy the webworks-<version>.js file into your application"

 

Right below that it says: "Make sure your application uses the version of this file that matches the current version. You can find thewebworks-<version>.js file in one of the following locations, depending on your platform:"  AND then it shows the folders its in.

 

So you need to call it in your project but no need to copy it to your project folder.  AFAIK.

If it helped you, click like. :smileyhappy:
Please use plain text.
Developer
DueNorth
Posts: 135
Registered: ‎09-25-2012
My Device: Dev Alpha
My Carrier: Rogers

Re: Problem using BBUI with webwerks

The first error is a known error.

 

See:

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Uncaught-SyntaxError-Unexpected-...

 

 

Everything else should work properly though, you should get to index.html. Show us your config.xml and index.html.

Please use plain text.
Regular Contributor
annuk
Posts: 82
Registered: ‎09-26-2012
My Device: Torch 9800
My Carrier: NA

Re: Problem using BBUI with webwerks

[ Edited ]

Hi,

Thanks for you reply.

I am just trying to test using the browser. When i use pushScreen('home.html','home' in body onload of the index.html it works fine.

 

But when i try using the document.addEventListener('webworksready', function(e) {} i get the error.

I am using google chrome 17.0.963.79 for testing.

 

The only thing that works is the imageList. Do Actionbars and menubars work on the browser?

My index.html is as follows:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html> 
	<head>
		<meta name="x-blackberry-defaultHoverEffect" content="false" />
		<link  rel="stylesheet" type="text/css" href="bbui-0.9.4.css"><link />
		<script type="text/javascript" src="bbui-0.9.4.js"></script>
		<script type="text/javascript" src="js/webworks-1.0.2.9.js"></script>
		<script type="text/javascript">
			document.addEventListener('webworksready', function(e) {
			
				
				bb.init({actionBarDark: true,
						controlsDark: true,
						listsDark: false,
						bb10ForPlayBook: false,
						highlightColor: highlightColor,
						onscreenready: function(element, id) {
											if (id == 'dataOnLoad') {
												dataOnLoad_initialLoad(element);
											} else if (id == 'masterDetail') {
												masterDetail_initialLoad(element);
											}
											
											if (bb.device.isBB10 && (id != 'input') && (id != 'pillButtons')) {
												var titles = element.querySelectorAll('[data-bb-type=title]');
												if (titles.length > 0) {
													titles[0].parentNode.removeChild(titles[0]);
												}
											}
											
										},
						
						ondomready: function(element, id) {
											if (id == 'dataOnTheFly') {
												dataOnTheFly_initialLoad(element);
											}
										}
						});
				bb.pushScreen('home.html', 'home');
			}, false);
		</script>
	</head>
	<body>
	</body>
</html>

 

Cant we test BBUI on browser?

 

Regards,

Annuk

 

Please use plain text.
Developer
DueNorth
Posts: 135
Registered: ‎09-25-2012
My Device: Dev Alpha
My Carrier: Rogers

Re: Problem using BBUI with webwerks

Hi Annuk,

 

That is an expected error. I have that one too. Everything should work fine.

 

If you went to the link I provided you would see that the error has been reported.

 

Hopefully it will be fixed on a future release.

Please use plain text.
Regular Contributor
annuk
Posts: 82
Registered: ‎09-26-2012
My Device: Torch 9800
My Carrier: NA

Re: Problem using BBUI with webwerks

Hi,

Thanks for your reply.

But how do i move forward. I am not able to proceed cause of this error. The index.html is not getting loaded. How do i test my code?

 

Regards,

Annuk

Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 614
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: Problem using BBUI with webwerks

Are you running this with Ripple enabled, or just in the standard Chrome browser?

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Problem using BBUI with webwerks

You can run bbUI in Ripple.. however Ripple has a bug where it will fire the webworksready event multiple times causing your bbUI init() code to fire multiple times.

 

I would suggest grabbing the latest v0.9.5 code from the next branch where the sample includes a work around to handle this Ripple bug.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Regular Contributor
annuk
Posts: 82
Registered: ‎09-26-2012
My Device: Torch 9800
My Carrier: NA

Re: Problem using BBUI with webwerks

Hi,

 

My chrome is ripple enabled.

 

Regards,

Annuk

Please use plain text.
Regular Contributor
annuk
Posts: 82
Registered: ‎09-26-2012
My Device: Torch 9800
My Carrier: NA

Re: Problem using BBUI with webwerks

Hi Tim,

 

When i am downloading the next branch, it still gives me V0.9.4 in samples as well as in pkg.

 

Regards,

 

Annuk.

 

 

Please use plain text.