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
Highlighted
Regular Contributor
Posts: 91
Registered: ‎10-27-2010
My Device: Passport SQW100-1
My Carrier: Meteor
Accepted Solution

BlackBerry 7 BBUI slow / not working

[ Edited ]

I'm, trying to convert my BlackBerry 10 BBUI webworks app to BlackBerry 6/7.

I have the 9320 simulator with OS 7.1.0.405.

 

I used the bbui documents and my blackberry 10 app to see how i should do.

I have webworks in the js folder otherwise the app does not do anything at all

 

 

Included files:

<script type="text/javascript" src="js/bbui.js"></script>
<script type="text/javascript" src="js/webworks.js"></script>

 

<script type="text/javascript">

window.addEventListener('load',function() {
document.addEventListener('webworksready', function(e) {

bb.init({
onbackkey: null,
actionBarDark: true,
controlsDark: true,
listsDark: true,
bb10ForPlayBook: true,
highlightColor: '#00A8DF',

onscreenready : function(element, id, params) { },
ondomready: function(element, id, params) { }

});


// start the app
console.log("app start");
bb.pushScreen('home.html', 'index');

}, false);
}, false);


</script>

 

 

in console the "app start" does not fire.

Basiclly it loads scrips and i get:

 

TypeError: Result of expression 'target' [null] is not an object.
Result of expression 'target' [null] is not an object.
 
But that's all what is happening.
 
 
Home.html
 

<div style="background-color: #2B2B2B; color: #fafafa;" data-bb-type="screen" data-bb-effect="none">

 

<div data-bb-type="menu">
<div onclick="bb.pushScreen('home.html', 'index');" data-bb-type="menu-item">Home</div>
<div onclick="bb.pushScreen('profile.html', 'profile');" data-bb-type="menu-item">Profile</div>
<div id="yourBtn" onclick="getFile()" data-bb-type="menu-item">Camera
<div style='height: 0px;width:0px; overflow:hidden;'><input id="fileTopostUpload" type="file" value="upload"onchange="sub(this)" accept="image/jpg"/></div></div>
<div onclick="bb.pushScreen('search.html', 'search');" data-bb-type="menu-item">Search</div>
<div onclick="bb.pushScreen('notifications.html', 'notifications');" data-bb-type="menu-item">Notifications</div>
<div onclick="bbminvite();" data-bb-type="menu-item">Invite</div>
<div onclick="bb.pushScreen('help.html', 'help');" data-bb-type="menu-item">Help</div>
<div onclick="bb.pushScreen('buycoins.html', 'boycoins');" data-bb-type="menu-item">Buy coins</div>
<div onclick="bb.pushScreen('settings.html', 'settings');" data-bb-type="menu-item">Settings</div>
</div>

 

<div data-bb-type="title" data-bb-img="images/icon.png"></div>
<div id="loadingimg" style="display:none;" class="img"><img src="ico/loading1.gif" alt="loading"/></div>

test test test test test test<br />

test test test test test test<br />
test test test test test test<br />
test test test test test test<br />

</div>

 
 
 
/* bbUI for BBOS VERSION: 0.9.6.153*/
 
the webworks file doesnt say a version, but i know it works because i have it in an other blackberry 7 app that works fine.
 
Maybe i forgot something?
I get a blink screen like it is going to an other page.
The page does not have content, but the menu button should work i guess?
 
 
It also says in the inspector that scripts are taking 20 seconds to load?
 
I also deleted every single extra js file i have included to see if there is one that makes it slow.
 
 
Anyone an idea?
 
 
 
 
 
 
Small update:
 
i tried the smallest file ever:

<script type="text/javascript">

window.addEventListener('load',function() {
document.addEventListener('webworksready', function(e) {

bb.init();

// start the app
console.log("app start");
bb.pushScreen('home.html', 'index');

}, false);
}, false);


</script>

 

it does not load home.html at all, not even trying.

 

 

Adding:

<script type="text/javascript" src="local:///chrome/webworks.js"></script>

or
<script type="text/javascript" src="local://chrome/webworks.js"></script>

 

didnt work either

 

 

I also tried:

 

document.addEventListener('webworksready', function(e) {
bb.init();
alert("push home.html");
bb.pushScreen('home.html', 'index');
}, false);

 

 

Nothing, not even the alert.

 

And as latest i tried:

 

- deleting almost everything from my config.xml

- deleting all js/css files except for bbui en webworks.js

 

 

still nothing, i think i tried every possible way.. and rebooting the simulator isn't that fun on every try

 

 

  1. Request URL:
    local:///chrome/webworks.js
  2. Request Method:
    GET
  3. Status Code:
    500 Error requesting resource.
  4. Request Headers
    1. Accept:
      */*
    2. User-Agent:
      Mozilla/5.0 (BlackBerry; U; BlackBerry 9320; en-GB) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.405 Mobile Safari/534.11+
  5. Response Headers
    1. x-rim-sniffed-mime-type:
      text/plain
       
       
       
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: BlackBerry 7 BBUI slow / not working

On BBOS, WebWorks applications come packaged with the functionality directly. You don't need to (and shouldn't) include webworks.js, and the webworksready event won't be firing either (blackberry APIs are ready out-of-the-box.)

You can see in the sample here that for PlayBook and BBOS, we're actually manually triggering the webworksready event:
https://github.com/blackberry/bbUI.js/blob/master/samples/bbos/index.htm#L95

The samlpe does still include local:///chrome/webworks.js, but that won't actually succeed being loaded on BBOS.

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.
Regular Contributor
Posts: 91
Registered: ‎10-27-2010
My Device: Passport SQW100-1
My Carrier: Meteor

Re: BlackBerry 7 BBUI slow / not working

I will try again tomorrow and copy the file only and see what happens.

Will come back with the results
Regular Contributor
Posts: 91
Registered: ‎10-27-2010
My Device: Passport SQW100-1
My Carrier: Meteor

Re: BlackBerry 7 BBUI slow / not working

I copied in the file exactly like you said, i only changed menu.htm in home.html.


result:

2webworks.jsFailed to load resource: the server responded with a status of 500 (Error requesting resource.)
TypeError: Result of expression 'target' [null] is not an object.
Result of expression 'target' [null] is not an object.
bbui.js:153TypeError: Result of expression 'blackberry.event' [undefined] is not an object.
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: BlackBerry 7 BBUI slow / not working

Hm, blackberry.event appears to be a BB10 API and the error is stemming from bbui.js. Did you switch out the BB10 BBUI source files for the BBOS BBUI source files? Specifically:
https://github.com/blackberry/bbUI.js/tree/master/pkg/bbos

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.
Regular Contributor
Posts: 91
Registered: ‎10-27-2010
My Device: Passport SQW100-1
My Carrier: Meteor

Re: BlackBerry 7 BBUI slow / not working

THANKS 100.000.000 times!

 

That's what you get for working in the middle of the night everyday.

You start seeing things that arn't there.

Regular Contributor
Posts: 91
Registered: ‎10-27-2010
My Device: Passport SQW100-1
My Carrier: Meteor

Re: BlackBerry 7 BBUI slow / not working

[ Edited ]

I dont feel like creating a new topic for this but:

 

https://developer.blackberry.com/devzone/files/design/bb7/UI_Guidelines_BlackBerry_Smartphones_7_1.p...

 

This page:

 

https://github.com/blackberry/bbUI.js/blob/master/samples/bbos/actionBar.htm

 

this code:

 

<div data-bb-type="action-bar">

<div data-bb-type="action" data-bb-style="button" data-bb-overflow="true" data-bb-accent-text="Home" data-bb-img="ico/home.png" onclick="showTab('tabOverflow');">Home</div>

<div data-bb-type="action" data-bb-style="button" data-bb-accent-text="Profile" data-bb-overflow="true" data-bb-img="ico/ic_contacts.png" onclick="showTab('tabOverflow');">Profile</div>

<div data-bb-type="action" data-bb-style="button" data-bb-selected="true" data-bb-img="ico/ic_compose.png" onclick="showTab('buttons');">Create</div>

<div data-bb-type="action" data-bb-style="button" data-bb-img="ico/search.png" onclick="showTab('tabs');">Search</div>

</div>

 

 

does not work, why? not even when i use 'tab' 

 

 

I tried including:   <script id="actionBarJS"src="js/actionBar.js"></script> in the file or header of the first file.

Also tried not to include it at all.

 

Whatever i do , it does not show.

 

How can i make sure that i get the bar?

Im using the simulator for 9320 with 7.1

 

 

Even when i click on trackpad nothing happens

 

 

 

 

 

config.xml

<feature id="blackberry.app" required="true" version="1.0.0.0"/>
<feature id="blackberry.app.event" required="true" version="1.0.0.0"/>
<feature id="blackberry.ui.menu" required="true" version="1.0.0.0"/>
<feature id="blackberry.ui.dialog" required="true" version="1.0.0.0"/>
<feature id="blackberry.push" required="true" version="1.0.0.0"/>
<feature id="blackberry.identity" required="true" version="1.0.0.0"/>
<feature id="blackberry.system.event" required="true" version="1.0.0.0"/>

 

 

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

Re: BlackBerry 7 BBUI slow / not working

This looks to be an issue with how the project was copied/pasted. In the documentation, ActionBar is only a BlackBerry 10 element:
https://github.com/blackberry/bbUI.js#blackberry-10-only-controls

In BBOS, the natural way to navigate / interact with applications is through the menu:
https://github.com/blackberry/bbUI.js/wiki/Screen-Menus

The ActionBar sample appears to have been left in for the BBOS sample, but should not have been.

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.
Regular Contributor
Posts: 91
Registered: ‎10-27-2010
My Device: Passport SQW100-1
My Carrier: Meteor

Re: BlackBerry 7 BBUI slow / not working

how about the actionbar documented in the os7 manual?

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

Re: BlackBerry 7 BBUI slow / not working

Which page is that on? I can't seem to find it.

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.