Thanks. :)
Am 30.08.2010 um 14:09 schrieb Guilherme Aiolfi:
Sure #4039
On Mon, Aug 30, 2010 at 4:59 AM, Martin Wittemann
<[email protected]<mailto:[email protected]>> wrote:
Hey,
thats kind of strange. Seems like the binding is not aware of changes of the
whole array itself. Changing its content works as expected.
my_model.getGender().push("M");
my_model.getGender().push("A");
This is the way I would suggest to use it because there is no need to create a
new array instance. But either way, it should work setting new arrays. Could
you open up a bug report for that?
Regards,
Martin
Am 27.08.2010 um 21:22 schrieb Guilherme Aiolfi:
Hi,
I'm trying to use the new feature in the list controller (deputy) but I can't
get it to work without the form controller.
Martin, you said the limitation for using it with multi selection was in the
form controller. To test it I'm not using the form controller and I'm using the
Object controller instead.
Here are some code to illustrate what I'm trying to do:
http://demo.qooxdoo.org/1.3-pre/playground/#%7B%22code%22%3A%20%22%252F*%2520************************************************************************%250A%250A%2520%2520%2520qooxdoo%2520-%2520the%2520new%2520era%2520of%2520web%2520development%250A%250A%2520%2520%2520http%253A%252F%252Fqooxdoo.org%250A%250A%2520%2520%2520Copyright%253A%250A%2520%2520%2520%2520%25202004-2008%25201%25261%2520Internet%2520AG%252C%2520Germany%252C%2520http%253A%252F%252Fwww.1und1.de%250A%250A%2520%2520%2520License%253A%250A%2520%2520%2520%2520%2520LGPL%253A%2520http%253A%252F%252Fwww.gnu.org%252Flicenses%252Flgpl.html%250A%2520%2520%2520%2520%2520EPL%253A%2520http%253A%252F%252Fwww.eclipse.org%252Forg%252Fdocuments%252Fepl-v10.php%250A%2520%2520%2520%2520%2520See%2520the%2520LICENSE%2520file%2520in%2520the%2520project's%2520top-level%2520directory%2520for%2520details.%250A%250A%2520%2520%2520Authors%253A%250A%2520%2520%2520%2520%2520*%2520Martin%2520Wittemann%2520(martinwittemann)%250A%250A************************************************************************%2520*%252F%250A%250A%252F**%250A%2520*%2520%2540tag%2520databinding%250A%2520*%2520%2540tag%2520list%2520contorller%250A%2520*%2520%2540tag%2520form%2520controller%250A%2520*%252F%250Aqx.Class.define(%2522demobrowser.demo.data.FormAndListController%2522%252C%250A%257B%250A%2520%2520extend%2520%253A%2520qx.application.Standalone%252C%250A%250A%2520%2520members%2520%253A%250A%2520%2520%257B%250A%2520%2520%2520%2520main%253A%2520function()%250A%2520%2520%2520%2520%257B%250A%2520%2520%2520%2520%2520%2520this.base(arguments)%253B%250A%250A%2520%2520%2520%2520%2520%2520var%2520genders_data%2520%253D%2520%255B%250A%2520%2520%2520%2520%2520%2520%2520%2520%257Blabel%253A%2520%2522male%2522%252C%2520data%253A%2520%2522M%2522%257D%252C%2520%250A%2520%2520%2520%2520%2520%2520%2520%2520%257Blabel%253A%2520%2522female%2522%252C%2520data%253A%2520%2522F%2522%257D%252C%2520%250A%2520%2520%2520%2520%2520%2520%2520%2520%257Blabel%253A%2520%2522dont%2520know!%2522%252C%2520data%253A%2520%2522WTF%2522%257D%252C%2520%250A%2520%2520%2520%2520%2520%2520%2520%2520%257Blabel%253A%2520%2522Alien%2522%252C%2520data%253A%2520%2522A%2522%257D%250A%2520%2520%2520%2520%2520%2520%255D%253B%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520create%2520some%2520dummy%2520data%250A%2520%2520%2520%2520%2520%2520var%2520my_data%2520%253D%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520firstname%253A%2520%2522Martin%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520lastname%253A%2520%2522Wittemann%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520gender%253A%2520%255B%255D%250A%2520%2520%2520%2520%2520%2520%257D%253B%250A%2520%2520%2520%2520%2520%2520var%2520genders_model%2520%253D%2520qx.data.marshal.Json.createModel(genders_data)%253B%250A%2520%2520%2520%2520%2520%2520var%2520my_model%2520%253D%2520qx.data.marshal.Json.createModel(my_data)%253B%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520firstname%250A%2520%2520%2520%2520%2520%2520var%2520firstname%2520%253D%2520new%2520qx.ui.form.TextField()%253B%250A%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520lastname%250A%2520%2520%2520%2520%2520%2520var%2520lastname%2520%253D%2520new%2520qx.ui.form.TextField()%253B%250A%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520gender%250A%2520%2520%2520%2520%2520%2520var%2520gender%2520%253D%2520new%2520qx.ui.form.List()%253B%250A%2520%2520%2520%2520%2520%2520gender.setSelectionMode(%2522multi%2522)%253B%250A%2520%2520%2520%2520%2520%2520var%2520genderController%2520%253D%2520new%2520qx.data.controller.List(null%252C%2520gender)%253B%250A%2520%2520%2520%2520%2520%2520genderController.setDelegate(%257BbindItem%253A%2520function(controller%252C%2520item%252C%2520index)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520controller.bindProperty(%2522label%2522%252C%2520%2522label%2522%252C%2520null%252C%2520item%252C%2520index)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520controller.bindProperty(%2522data%2522%252C%2520%2522model%2522%252C%2520null%252C%2520item%252C%2520index)%253B%2520%2520%2520%2520%2520%2520%2520%2520%250A%2520%2520%2520%2520%2520%2520%257D%257D)%253B%250A%2520%2520%2520%2520%2520%2520genderController.setModel(genders_model)%253B%250A%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520create%2520the%2520form%2520and%2520add%2520it%2520to%2520the%2520root%250A%2520%2520%2520%2520%2520%2520this.getRoot().add(firstname%252C%2520%257Bleft%253A%252030%252C%2520top%253A%252020%257D)%253B%250A%2520%2520%2520%2520%2520%2520this.getRoot().add(lastname%252C%2520%257Bleft%253A%252030%252C%2520top%253A%252050%257D)%253B%250A%2520%2520%2520%2520%2520%2520this.getRoot().add(gender%252C%2520%257Bleft%253A%252030%252C%2520top%253A%252080%257D)%253B%250A%2520%2520%2520%2520%2520%2520%250A%2520%2520%2520%2520%2520%2520var%2520controller%2520%253D%2520new%2520qx.data.controller.Object(my_model)%253B%250A%250A%2520%2520%2520%2520%2520%2520controller.addTarget(firstname%252C%2520%2522value%2522%252C%2520%2522firstname%2522%252C%2520true)%253B%250A%2520%2520%2520%2520%2520%2520controller.addTarget(lastname%252C%2520%2522value%2522%252C%2520%2522lastname%2522%252C%2520true)%253B%250A%2520%2520%2520%2520%2520%2520controller.addTarget(genderController%252C%2520%2522selection%2522%252C%2520%2522gender%2522%252C%2520true)%253B%250A%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520A%2520button%2520to%2520log%2520the%2520models%2520content%250A%2520%2520%2520%2520%2520%2520var%2520logButton%2520%253D%2520new%2520qx.ui.form.Button(%2522Show%2520model%2520data%2520in%2520the%2520log%2522)%253B%250A%2520%2520%2520%2520%2520%2520this.getRoot().add(logButton%252C%2520%257Bleft%253A%2520240%252C%2520top%253A%252020%257D)%253B%250A%2520%2520%2520%2520%2520%2520logButton.addListener(%2522execute%2522%252C%2520function()%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520this.debug(qx.dev.Debug.debugProperties(my_model))%253B%250A%2520%2520%2520%2520%2520%2520%257D%252C%2520this)%253B%250A%2520%2520%2520%2520%2520%2520my_model.setGender(new%2520qx.data.Array(%255B%2522M%2522%252C%2520%2522WTF%2522%255D))%253B%250A%2520%2520%2520%2520%2520%2520%252F%252Fgender.setModelSelection(%255B%2522WTF%2522%255D)%253B%2520%252F%252F%2520that%2520works%2520bu%2520I%2520should%2520be%2520able%2520to%2520do%2520model.setGender(%255B%2522WTF%2522%255D)%253B%252C%2520shouldn't%2520I%253F%250A%2520%2520%2520%2520%257D%250A%2520%2520%257D%250A%257D)%253B%22%7D<http://demo.qooxdoo.org/1.3-pre/playground/#%7B%22code%22%3A%20%22%252F*%2520************************************************************************%250A%250A%2520%2520%2520qooxdoo%2520-%2520the%2520new%2520era%2520of%2520web%2520development%250A%250A%2520%2520%2520http%253A%252F%252Fqooxdoo.org%250A%250A%2520%2520%2520Copyright%253A%250A%2520%2520%2520%2520%25202004-2008%25201%25261%2520Internet%2520AG%252C%2520Germany%252C%2520http%253A%252F%252Fwww.1und1.de%250A%250A%2520%2520%2520License%253A%250A%2520%2520%2520%2520%2520LGPL%253A%2520http%253A%252F%252Fwww.gnu.org%252Flicenses%252Flgpl.html%250A%2520%2520%2520%2520%2520EPL%253A%2520http%253A%252F%252Fwww.eclipse.org%252Forg%252Fdocuments%252Fepl-v10.php%250A%2520%2520%2520%2520%2520See%2520the%2520LICENSE%2520file%2520in%2520the%2520project's%2520top-level%2520directory%2520for%2520details.%250A%250A%2520%2520%2520Authors%253A%250A%2520%2520%2520%2520%2520*%2520Martin%2520Wittemann%2520(martinwittemann)%250A%250A************************************************************************%2520*%252F%250A%250A%252F**%250A%2520*%2520%2540tag%2520databinding%250A%2520*%2520%2540tag%2520list%2520contorller%250A%2520*%2520%2540tag%2520form%2520controller%250A%2520*%252F%250Aqx.Class.define(%2522demobrowser.demo.data.FormAndListController%2522%252C%250A%257B%250A%2520%2520extend%2520%253A%2520qx.application.Standalone%252C%250A%250A%2520%2520members%2520%253A%250A%2520%2520%257B%250A%2520%2520%2520%2520main%253A%2520function()%250A%2520%2520%2520%2520%257B%250A%2520%2520%2520%2520%2520%2520this.base(arguments)%253B%250A%250A%2520%2520%2520%2520%2520%2520var%2520genders_data%2520%253D%2520%255B%250A%2520%2520%2520%2520%2520%2520%2520%2520%257Blabel%253A%2520%2522male%2522%252C%2520data%253A%2520%2522M%2522%257D%252C%2520%250A%2520%2520%2520%2520%2520%2520%2520%2520%257Blabel%253A%2520%2522female%2522%252C%2520data%253A%2520%2522F%2522%257D%252C%2520%250A%2520%2520%2520%2520%2520%2520%2520%2520%257Blabel%253A%2520%2522dont%2520know!%2522%252C%2520data%253A%2520%2522WTF%2522%257D%252C%2520%250A%2520%2520%2520%2520%2520%2520%2520%2520%257Blabel%253A%2520%2522Alien%2522%252C%2520data%253A%2520%2522A%2522%257D%250A%2520%2520%2520%2520%2520%2520%255D%253B%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520create%2520some%2520dummy%2520data%250A%2520%2520%2520%2520%2520%2520var%2520my_data%2520%253D%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520firstname%253A%2520%2522Martin%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520lastname%253A%2520%2522Wittemann%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520gender%253A%2520%255B%255D%250A%2520%2520%2520%2520%2520%2520%257D%253B%250A%2520%2520%2520%2520%2520%2520var%2520genders_model%2520%253D%2520qx.data.marshal.Json.createModel(genders_data)%253B%250A%2520%2520%2520%2520%2520%2520var%2520my_model%2520%253D%2520qx.data.marshal.Json.createModel(my_data)%253B%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520firstname%250A%2520%2520%2520%2520%2520%2520var%2520firstname%2520%253D%2520new%2520qx.ui.form.TextField()%253B%250A%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520lastname%250A%2520%2520%2520%2520%2520%2520var%2520lastname%2520%253D%2520new%2520qx.ui.form.TextField()%253B%250A%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520gender%250A%2520%2520%2520%2520%2520%2520var%2520gender%2520%253D%2520new%2520qx.ui.form.List()%253B%250A%2520%2520%2520%2520%2520%2520gender.setSelectionMode(%2522multi%2522)%253B%250A%2520%2520%2520%2520%2520%2520var%2520genderController%2520%253D%2520new%2520qx.data.controller.List(null%252C%2520gender)%253B%250A%2520%2520%2520%2520%2520%2520genderController.setDelegate(%257BbindItem%253A%2520function(controller%252C%2520item%252C%2520index)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520controller.bindProperty(%2522label%2522%252C%2520%2522label%2522%252C%2520null%252C%2520item%252C%2520index)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520controller.bindProperty(%2522data%2522%252C%2520%2522model%2522%252C%2520null%252C%2520item%252C%2520index)%253B%2520%2520%2520%2520%2520%2520%2520>
As you can see: my_model.setGender() is not propagating the changes to the UI.
I think it's a bug because I'm creating a bidirectional binding.
or is there anything wrong with my code?
<ATT00001..txt><ATT00002..txt>
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
<ATT00001..txt><ATT00002..txt>
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel