Hello Jean-Noel,
first of all, thanks for the compliments for the data binding
layer. :) I have answered your questions below.
Hi,
I had a look at the data binding framework of Qooxdoo which looks
great and promising. I have a question though, it looks like there
is some support for pulling data out of a data source and then
binding it to a view widget via the Json store class, then the
controllers. But is the other direction possible, eg, detect a
change to the model which was bound to a widget, and automatically
make a server call back to the web server to update the data source
(probably a relational DB).
Sure that is possible. But we dont have a store ready for it yet. You
can see an example for writing data back from the model in the gears
demo in the demo browser. Specially for such a scenario, a bubble
event mechanism has been introduced to the generated models. That way
you dont have to listen to every single value in the model.
You can take a look at the API or the code to see how it works:
http://demo.qooxdoo.org/devel/apiviewer/#qx.data.marshal.MEventBubbling
Of course, such an automatic change may cause some problems, so it
should be configurable I guess (only update when the user presses a
specific button for instance). I guess I could also manually code
something up pretty quickly thanks to Qooxdoo events launched on the
model (writing code on _apply for instance), but I was wondering,
has anyone thought of this functionality? It would be nice if it
were implemented in a way which makes sense.
Sure we have thought of that. Its on our todo list to get something in
that direction out of the box.
Second question, because of cross domain concerns, I am using the
script implementation when making server calls. Is this option
available when using the Json store? Eg, is it possible to use the
current Json store with a server call via a script transport
implementation.
It is possible but not right out of the box. Just take a look at the
twitter or flicker demo in the demobrowser. Each of them uses a
special store implementation and a other object for transport (both
use JSONP). I guess exactly the same way you could change the
transport layer.
Third question, the docs about using a delegate for data-binding
don't mention how to actually use the delegate with the
controller ?! Eg, once you wrote your delegate, how do you hook it
up in your controller?
The lists and tree controller support the delegation mechanism. Both
of them have a property called delegate where the created delegate
object should be set via setDelegate(...). Thats all. :)
Last question, I am interested in the hierarchy data binding ("A
more advanced feature of the single value binding is to bind a
hierarchy of properties to a target property.")
However, conceptually, with a complex model, there could be more
than one child for the parent object.
Eg, how would you adapt the current following code to a case where a
has a "b" node but also a "c" node with a different property? Does
not look possible currently...
var a = new Node("a"); // set the name to „a“
var b = new Node("a"); // set the name to „b“
a.setChild(b);
// bind the property to a labels content
a.bind("child.name", label, "content");
The binding always goes down from one property to another. If you
change something in the chain, the binding tries to get down the new
property chain. If thats not possible, the target property will be
reseted.
I did recently a presentation on the whole data binding layer. Perhaps
the slides could make the concept of the "deep binding" better
understandable. You can find the slides on my slideshare account. http://www.slideshare.net/wittemann/data-binding-in-qooxdoo
Thanks for the help!
Jean-Noel
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally
facing
server and web deployment.
http://p.sf.net/sfu/businessobjects_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
I hope all the questions are like you expected them? If you have
further questions, dont hesitate to ask. :)
Best,
Martin
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel