« Return to Thread: Data Binding and Map Vars

Data Binding and Map Vars

by Guilherme Aiolfi :: Rate this Message:

Reply to Author | View in Thread

Hi Martin and others,

I was trying to use data bindings with hash maps, the native ones. Here something I tried:

--code--
var textfield = new qx.ui.form.TextField();
var obj = {};
textfield.setLiveUpdate(true);
var doc = this.getRoot();
doc.add(textfield,    {          left : 100,          top  : 50     });
doc.add(label,        {          left: 100,          top: 75        });
textfield.bind("value", obj, "textfield");
textfield.setValue("cssadas");
alert(obj["textfield"]);
--code--

That didn't work. Is there someway to use data bindings with Map vars? If so, how?

I'm asking because I created a class qx.data.Map (just to add an event to the set method), basead on qx.data.Array and with some changes in the qx.data.SingleValueBinding, the data binding in a map var worked.

It would be a great addition to qooxdoo that would increase its flexibility. And I guess it's not that hard to achieve it with the actual structure.

What do you think?

------------------------------------------------------------------------------

_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

 « Return to Thread: Data Binding and Map Vars