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

New Developer
Posts: 17
Registered: ‎01-01-2009
My Device: Not Specified

bbUI.js - onscreenready event not firing in BB10 simulator

[ Edited ]



I have a bbUI.js BB10 application that works fine in Ripple.  When I package and launch to the simulator, all I see is a blank white screen.  Putting some alert() statements in the code has revealed that onscreenready() is not firing.


I'm stuck.  Does anyone have any suggestions as to how to address this?


(EDIT: I have the latest versions of WebWorks, Ripple and the BB10 VMware image installed) 


Here is my index.html if that helps:

<!DOCTYPE html>
          <link  rel="stylesheet" type="text/css" href="css/bbui.css"></link>
          <script type="text/javascript" src="js/bbui.js"></script>
          <script type="text/javascript" src="js/constants.js"></script>
          <script type="text/javascript" src="js/common.js"></script>
          <script type="text/javascript" src="local:///chrome/webworks.js"></script>
        <!-- google maps -->
        <script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
		<script type="text/javascript">
			var webworksreadyFired = false;
			document.addEventListener('webworksready', function(e) {
				// This is code to ensure that if webworksready is fired multiple times we still only init() one time
				if (webworksreadyFired) return;
				webworksreadyFired = true;
				// You must call init on bbUI before any other code loads.  
				// If you want default functionality simply don't pass any parameters.. bb.init();
						actionBarDark: true,
						controlsDark: true,
						listsDark: false,
						bb10ForPlayBook: true,
						coloredTitleBar: true,

						// Fires "before" styling is applied and "before" the screen is inserted in the DOM
						onscreenready: function(element, id, params) {
							alert('onscreenready: ' + id);
							if (id == 'home')
								home_screenReady(element, params);
							else if (id == 'list')
								list_screenReady(element, params);
							else if (id == 'detail')
								detail_screenReady(element, params);
							else if (id == 'profile')
								profile_screenReady(element, params);
						ondomready: function(element, id, params) {
							if (id == 'list')
								// check server for list updates
								list_domReady(element, params);
							else if (id == 'detail')
								// map addresses on detail screen
								detail_domReady(element, params);
				alert('before push first screen');
				bb.pushScreen('home.html', 'home', true);  // true indicates to refresh the list
			}, false);
			// Fire the webworksready event for PlayBook and BBOS
				window.addEventListener('load',function() {
					if (navigator.userAgent.indexOf('Version/10.0') < 0) {
						var evt = document.createEvent('Events');
						evt.initEvent('webworksready', true, true);


Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: bbUI.js - onscreenready event not firing in BB10 simulator

Have you verified that webworksready is being fired? Have you had a chance to connect Web Inspector and verify if any errors are being thrown?

Nothing seems off about your code from an initial glance...

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.