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
Developer
Posts: 161
Registered: ‎02-08-2012
My Device: PlayBook
My Carrier: None yet

loading screen?

Anyone know a way to add some kind of a loading screen, when your app has to load a metric ton of JavaScript from within the <head> tag?

 

 

Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: loading screen?

Add a loading div to your HTML and hide it when you're done.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Developer
Posts: 161
Registered: ‎02-08-2012
My Device: PlayBook
My Carrier: None yet

Re: loading screen?

It's going to need to be some kind of a native solution, it looks like, unless there's some sort of support for that built in already that I haven't yet located -- nothing is rendered until after the head tag is processed.
Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: loading screen?

WebWorks does support the rim:loadingScreen element which you can add to your config.xml document:

 

https://bdsc.webapps.blackberry.com/html5/documentation/ww_developing/rim_loadingscreen_element_8346...

 

This allows you to display an image when the application is first started, and anytime an HTTP request occurs to load a new page.

 

Q: does the JavaScript you are loading occur at page-load time, or does it happen in response to a user action (e.g. clicking on a button)?  If its the latter, then the rim:loadingScreen element is not the right use-case, and maybe some dynamic HTML / progress indicator would be better.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Developer
Posts: 161
Registered: ‎02-08-2012
My Device: PlayBook
My Carrier: None yet

Re: loading screen?

Thanks, Adam. I did remember seeing something about that somewhere, but I couldn't actually locate where it was anymore.

I'm busy working right now, so I haven't got a chance to try that out, but I'm hoping that will work -- if it doesn't go away until after the document is actually loaded, then it should be good.

There is a large amount of Javascript stuff that is loaded in the <head> of the document, the entire app is loaded there.

Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: loading screen?

In my experience, this feature won't help you. It simply replaces the standard loading screen while the chromeless browser is loaded. Once your index.html starts loading, that screen disappears and you'll be left with the same problem.

Some frameworks (ie Sencha) take care of everything for you, but you could use a solution like head.js to achieve your goal.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.