11-02-2012 09:30 AM
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.
I am using the sample code provided with BB UI.
Where am i going wrong.
Regards,
Annuk
11-02-2012 11:12 AM - edited 11-02-2012 11:12 AM
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.
11-02-2012 01:03 PM
The first error is a known error.
See:
Everything else should work properly though, you should get to index.html. Show us your config.xml and index.html.
11-03-2012 06:48 AM - edited 11-03-2012 06:49 AM
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
11-04-2012 12:25 PM
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.
11-05-2012 12:25 AM
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
11-05-2012 09:01 AM
Are you running this with Ripple enabled, or just in the standard Chrome browser?
11-05-2012 10:03 AM
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.
11-06-2012 12:12 AM
Hi,
My chrome is ripple enabled.
Regards,
Annuk
11-06-2012 12:43 AM
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.