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
New Developer
JamesPtheNerd
Posts: 14
Registered: ‎06-09-2012
My Device: Red LE Z10; PlayBook, BlackBerry Bold 9780; Torch 9800; Dev Alpha C
My Carrier: Telus Mobility
Accepted Solution

bbui.js 0.9.2 does not execute in Smartphone WebWorks application

[ Edited ]

Trying to solve a tricky issue:

 

 My app (written in HTML5 with bbui.js) works fine in the Ripple Emulator, as well as on PlayBook/OS10 hardware and simulators. Haven't tried a Smartphone simulator yet... but it seems that just after the splashscreen, the app does not launch. Blank screen. 

 

 Thinking it was my code, I tried a STOCK pull and compile of the bbui.js sample directory. SAME Issue. Odd!!

 

 Troubleshooting further, in my index.htm if I place some code in the <body> tag (after the .pushscreen()), it does appear as rendered html. So, clearly, the bbui.js code is not launching on the Smartphone device (BB Bold 9780, 6.0 Bundle 2921 v6.0.0.666,Platform 6.6.0.241).

 

 I'll try a smartphone simulator (i'm on mac... there are none, hopefully they run in a Windows VM via VMWare Fusion), but I'm curious why this won't load.

 

 Attached are my index.htm, config.xml, and even menu.htm (though I don't think that's required).

 

--
James Robert Perih
http://www.cardcloud.com/jperih
Please use plain text.
New Developer
JamesPtheNerd
Posts: 14
Registered: ‎06-09-2012
My Device: Red LE Z10; PlayBook, BlackBerry Bold 9780; Torch 9800; Dev Alpha C
My Carrier: Telus Mobility

Re: bbui.js 0.9.2 does not execute in Smartphone WebWorks application

Same result on Simulator, OS6. 

Trying OS7.

--
James Robert Perih
http://www.cardcloud.com/jperih
Please use plain text.
New Developer
JamesPtheNerd
Posts: 14
Registered: ‎06-09-2012
My Device: Red LE Z10; PlayBook, BlackBerry Bold 9780; Torch 9800; Dev Alpha C
My Carrier: Telus Mobility

Re: bbui.js 0.9.2 does not execute in Smartphone WebWorks application

Well... doesn't run in an OS7 simulator, BUT I'm happy for Remote Debugger feature of OS7!! 

 

Turns out there is a glitch in my git pull request on line 211 (looks REALLY wacky... and didn't effect PlayBook hardware, BB10 Hardware, either simulators, and Ripple. Funny..

Or, my kitten has decided to try her hand at coding while I'm afk).IMG_0060.jpg

 

Pulled fresh copy, will post results.

--
James Robert Perih
http://www.cardcloud.com/jperih
Please use plain text.
New Developer
JamesPtheNerd
Posts: 14
Registered: ‎06-09-2012
My Device: Red LE Z10; PlayBook, BlackBerry Bold 9780; Torch 9800; Dev Alpha C
My Carrier: Telus Mobility

Re: bbui.js 0.9.2 does not execute in Smartphone WebWorks application

Now, this is REALLY strange;

 

BBUI.js code, at 211, in my project, is this:

                        result = this.getElementById( id, child );

But, when it's compiled and makes its way onto my device, and I use the remote inspector, the app claims that line 211 is this:

resultth; i++) {

 

No word of a lie... here's that entire codeblock declaring container.getElementById = function (id, node) { from 199 in my compiled app:

// Add getElementById for the container so that it can be used in the onscreenready event
container.getElementById = function(id, node) {
   var result = null;
   if (!node) {
      node = this;
   }

   if ( node.getAttribute('id') == id )
      return node;

   for ( var i = 0; i < node.childNodes.length; i++) {
      var child = node.childNodes[i];
      if ( child.nodeType == 1) {
         resultth; i++ {
   document.body.appenChild(newScriptTags[i]);
   newSCriptTags[i].onload = function () {
      bb.screen.scriptCounter++;
      if(bb.screen.scriptCounter == bb.screen.totalScripts) {
         bb.initContainer(container, id);
      }
   };
}

// In case there are no scripts at all we simple doLoad() now

 

But bbui.js from github (and from my source) says this:

        // Add getElementById for the container so that it can be used in the onscreenready event
        container.getElementById = function(id, node) {
                var result = null;
                if (!node) {
                    node = this;
                }

                if ( node.getAttribute('id') == id )
                    return node;

                for ( var i = 0; i < node.childNodes.length; i++ ) {
                    var child = node.childNodes[i];
                    if ( child.nodeType == 1 ) {
                        result = this.getElementById( id, child );
                        if (result)
                            break;
                    }
                }
                return result;
            };

        // Special handling for inserting script tags
        bb.screen.scriptCounter = 0;
        bb.screen.totalScripts = newScriptTags.length;
        for (var i = 0; i < newScriptTags.length; i++) {
                document.body.appendChild(newScriptTags[i]);
                newScriptTags[i].onload = function() {
                    bb.screen.scriptCounter++;
                    if(bb.screen.scriptCounter == bb.screen.totalScripts) {
						bb.initContainer(container, id);
                    }
                };
        }

        // In case there are no scripts at all we simply doLoad() now

 

 Something is MUNCHING the code when it's compiled!! Could Ripple be doing this? I suppose I'll try a commandline bbwp compile, but that was the first step I did before using Ripple, with the same result...

--
James Robert Perih
http://www.cardcloud.com/jperih
Please use plain text.
New Developer
JamesPtheNerd
Posts: 14
Registered: ‎06-09-2012
My Device: Red LE Z10; PlayBook, BlackBerry Bold 9780; Torch 9800; Dev Alpha C
My Carrier: Telus Mobility

Re: bbui.js 0.9.2 does not execute in Smartphone WebWorks application

Well... i guess no one is here..

 

Anyway, I have a work-around for this; I just minified the bbui-0.9.2.js file at http://jscompress.com/, named the result bbui-0.9.2.min.js and reflected this in the index.htm file.

 

Works! on OS6 and OS7.

--
James Robert Perih
http://www.cardcloud.com/jperih
Please use plain text.