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
New Developer
Posts: 13
Registered: ‎10-19-2010
My Device: 9000
My Carrier: AT&T
Accepted Solution

First Webworks on 9800: screen is mostly blank vs. but not on browser

My webworks app simply isn't rendering even though I can tell the at least index.html is loading.  I'm testing by creating a config.xml that points to my server.  Now, when I load this webapp in the on-simulator browser, it looks and behaves fine.  However, now when I load that webapp via my webworks app, which points to the same location as my browser just did, it basically doesn't render (I get a 5-ish pixel blue line across the top).  

 

So, I guess I have two questions:

- Under what circumstances would a webworks app render differently than the browser?

- Is there anyway to view console.log output w/o resorting to Phonegap, or any way to see error messages?

 

FYI: 

This is an unsigned app that doesn't use any special BB API

Other external sites, such as twitter.com, or simpler flavors of my own web app, work fine, too.

Running latest Java and Simulator 6.0.0.246 (9800-ATT)

 

Related (?) Question from a few years ago:

http://stackoverflow.com/questions/838069/why-does-google-com-look-different-on-blackberry-phonegap-...

 

 

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: First Webworks on 9800: screen is mostly blank vs. but not on browser

Hi jjrohrer,

 

Do you have any CSS that was taking into account the browser chrome (top toolbar) that could be causing the CSS difference?

 

Also, in a WebWorks app the web view grows to the size of the content.  So if the page is shorter than the size of the screen, the background color of the application will be shown at the bottom of the web content.

 

This can be worked around by setting the viewport or by running the following onload

 

document.body.style.height = screen.height + 'px';

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Developer
Posts: 13
Registered: ‎10-19-2010
My Device: 9000
My Carrier: AT&T

Re: First Webworks on 9800: screen is mostly blank vs. but not on browser

Cool. I'm not sure what, precisely is causing my problem, but it is very helpful knowing that the rendering engine is literally the same code as is in the browser app (right?).

BTW - I'd still really like to know if there is any way to see console.log output.
New Developer
Posts: 13
Registered: ‎10-19-2010
My Device: 9000
My Carrier: AT&T

Re: First Webworks on 9800: screen is mostly blank vs. but not on browser

Ok - I figure it out, though it doesn't make sense.

 

I had accidently put this in redundant viewport meta data, which didn't seem to be a problem in the browser, but hosed the widget.

 

First one: 

 

    <!-- no scroll on blackberry  -->
    <meta name="viewport" id="viewport" content="width=360,height=480,initial-scale=1.0,user-scalable=no">

Second one (evil):

 

	<!-- No Zoom -->
	<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
  

 

 

This second entry totally hosed the display.  Removing it seems to have solved the problem.  

 

Just for the record, this second entry didn't seem to bother the browser - things displayed normally.