|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Data Binding and Map VarsHi 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 |
|
|
Re: Data Binding and Map VarsHello Guilherme,
im not surprised that this does not work. The data binding is currently restricted to properties. We decided that because they can offer the change notifications we need for the source values of the binding. So plain javascript maps would not work as sources for the binding. But I guess you already know that because your example shows the usage of a map as target. Implementing that functionality could be some work because there can be a couple of variants in the target property chain. See some examples here: a.b.c.d a[0].b a[last] Additionally you have no idea of how to reset such keys in a map because there is no additional information. Setting the value to null would maybe the only reasonable way to do a reset. So I don't know if we want to take that step of additional work and a increase of code size and complexity in the data binding. Perhaps you can tell me how a map would help you or why you need it? Why don't you just use the marshaler and create a qooxdoo object from that map? Best, Martin Am 06.07.2009 um 22:54 schrieb Guilherme Aiolfi: Hi Martin and others, ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/blackberry _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Data Binding and Map VarsHi again,
On Tue, Jul 7, 2009 at 4:00 AM, Martin Wittemann <martin.wittemann@...> wrote:
I was thinking about it, and I guess "last" should be allow for Map and replace "last" for, amm, "#last" or "*last", I don't know.
It would be easier to ready the code as [last] gives the impression that it's an index, and it's not, it's a key to an index. #last gives that ideia of keys.
Ok, maybe I'm not using the right tools for the jog. Here is the scenario that I imagine to use Maps: A form where I don't know its fields before them really exist. Not knowing its fields It would have to be allow the object to grow as needed. Can I do it with regular Objects?
If reseting to null is not enough, Map could store more information about its indexes if needed. The default behavior would be reset to null, though.
------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/blackberry _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
| Free embeddable forum powered by Nabble | Forum Help |