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
Contributor
MichalKozminski
Posts: 36
Registered: ‎07-05-2012
My Device: 9900 & dev alpha
My Carrier: Play - P4

Data binding framework for bbUI

Hi,

I started creating client of web app. I want it to have offline cache DB from which can pull data just then user touch button. But then it have to load data from web and reload GUI (Visualization). So is there any framework which will let me do this? I tried knockout.js and backbone but then I reloaded data the page looked like there were no CSS. 

Thanks for advices.

Please use plain text.
BlackBerry Development Advisor
anzor_b
Posts: 164
Registered: ‎09-24-2012
My Device: White BlackBerry 10
My Carrier: Bell

Re: Data binding framework for bbUI

[ Edited ]

Hi MichalKozminski,

I use Backbone.js to fetch data from the server. It's very convenient and is done with one command: collection.fetch();

 

Please look at the following simple example, it shows how to fetch data and re-render view with more data. If you have issues deploying it on the device/ripple, let me know and I will assist where I can.

 

URL: http://drumcoder.co.uk/blog/2012/apr/27/getting-started-backbonejs/

 

Edit: I just noticed you are referring to BBUI.js, I was able to implement Backbone with BBUI, but I had to re-write the views (gridList, imageList) as Backbone views in order to make it dynamic. My router called bb.pushScreen() when visiting pages. Otherwise, you can use an AJAX request from script tag.

 

Please use plain text.
New Developer
techsaint
Posts: 3
Registered: ‎10-02-2012
My Device: Playbook 16GB
My Carrier: verizon

Re: Data binding framework for bbUI

I currently use AngularJS and Amplify.Store for the backend storage. 

Please use plain text.
New Contributor
quamat
Posts: 9
Registered: ‎11-26-2012
My Device: BB10 Dev Alpha
My Carrier: Developer

Re: Data binding framework for bbUI

Hi! I'm trying to do the same, but I can't make Backbone to work toghether with bbUI.

I can't make it work from onscreenready.

I can create my Backbone views only after ondomready.

Could you please give me some hint on how you rewrote the views as Backbone views?

 

 

Please use plain text.
Contributor
MichalKozminski
Posts: 36
Registered: ‎07-05-2012
My Device: 9900 & dev alpha
My Carrier: Play - P4

Re: Data binding framework for bbUI

Can you give some code example with this problem?

I just started developing Trello client with backbone: https://github.com/michalkozminski/BB10_Trello-backbone

so you can have a look on  my code. 

Please use plain text.
New Contributor
quamat
Posts: 9
Registered: ‎11-26-2012
My Device: BB10 Dev Alpha
My Carrier: Developer

Re: Data binding framework for bbUI

Thank you very much for the quick reply.

 

Looking at your code, I've seen that you don't use the onscreenready function inside bb.init() in your index.html page.

So you are editing the html code of your views AFTER those have been attached to the DOM?

 

Shouldn't we better render the html in the onscreenready function?

Please use plain text.
Contributor
MichalKozminski
Posts: 36
Registered: ‎07-05-2012
My Device: 9900 & dev alpha
My Carrier: Play - P4

Re: Data binding framework for bbUI

Yes it's better but if you done this that way you will have to wait for DOM to load until you fetch data from server.

Please use plain text.