Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
09-17-2013 01:11 PM
I think I've solved most of my problems with getting my data to be usable in various functions etc... but by problem now (which may have been the fundamental problem all along) is related to the asychronous nature of Web Database processing.
I get my markup back as a <div> with all the 'data-bb-type' etc. attributes, but based on the "alert" statements I have sprinkled throughout my code, the database results are processed after the "onscreenready" event has finished and "ondomready" has started.
I know that if you're going to generate markup for use with BBUI.js, it has to go into the "screen" before the "screen" is passed to BBUI.js so BBUI can do all it's fancy stuff to it.
I've tried to make sense of it, but it eludes me. Perhaps someone could point me in the right direction for a good tutorial that explains in some clear way what is going on behind the scenes and then I guess I'll have to rip my code apart and put it back together... or at least call functions in a different way or from a different place, or use callbacks more liberally (I'm not exactly clear on use of callbacks either).
Solved! Go to Solution.
09-18-2013 10:57 PM - edited 09-18-2013 11:02 PM
BUMP. I've seen easy-to-understand code for reading SQLite... I've seen easy-to-understand code for interacting with existing BBUI.js objects... I haven't yet found any sample code that hits a SQLite database for a given BBUI "screen" and then fills that screen with objects derived from the SQLite database result. Is there any sample code that fetches the data via SQLite query and processes it into BBUI.js-compatible markup all within the 'onscreenready' event?
Is it possible that I should perform all my 'bulk' queries in the initApp function (pull all the data from all the SQLite tables into objects, ready to process) when the app launches, then in "onscreenready" just process the object into the markup?
I think that approach would work, but I think I'm right in trying to avoid an approach that is "top heavy" and I think I want to rule out other (what I think are very likely) more correct approaches before I resort to basically bringing the entire SQLite database into memory and keeping it there / interacting with objects AND the database at every turn.
09-21-2013 02:38 PM
09-22-2013 12:13 AM