On Wed, Apr 28, 2010 at 11:40 AM, MartinWittemann
<[email protected]> wrote:
>
> Hi,
>
> Well, you can not just take the single value binding code and give it to the
> form controller. I didn't expect that to work. :)
>
> I added for the upcoming release a demo to show how form and list controller
> can work together. I changed it a bit to show how you can add your
> difference between name and id to the selectbox:
>
> http://tinyurl.com/2w6df5n
>
> As you can see in the log, the name and the id is in the model so reading
> one of both should not be a problem.
>
> Regards,
> Martin
Hello Martin,
Just some random thoughts in the night: it could be awesome and
powerful if a list controller could have a modelPath. So you could do
something like:
....
var = data [
{name: "male", id: 1},
{name: "female", id: 2},
{name: "dont know!", id: 3},
{name: "Alien", id: 4}
];
var model = qx.data.marshal.Json.createModel(data);
var gender = new qx.ui.form.SelectBox();
var controller = new qx.data.controller.List(model.getGender(), gender, "name");
controller.setModelPath("id");
form.add(gender, "Gender");
....
Also sometimes one only needs a quick and dirt select box, without
wanting to think about controllers, etc. To this extents I have a
simple SelectBox that works like this (which internally of courses
uses a marshaler and a list controler):
form.add(new qx.ui.form.SimpleSelectBox(["male", "female"]), "Gender");
Regards,
Eduardo Robles Elvira.
------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel