Hi,

try that:

listController.setDelegate({
       bindItem: function(controller, item, index) {
                     controller.bindProperty("label", "label", null, item,
index);
                     controller.bindProperty("key", "model", null, item,
index);
       }
});

then:

this.__controller.addTarget(listController,
"selection[0]", item.getBinding(), true);


But I agree, this.__controller.addTarget(listController, "selection[0].key",
...); would be much nicer.

On Wed, Oct 20, 2010 at 2:07 PM, Claus Straube <[email protected]>wrote:

> Hi all,
>
> I've got a form with a list controller and an object controller. The
> values of the 'itemList' are property objects ({key: "foo", value:
> "bar"}). I want to show in a SelectBox the value und bind the key to my
> object data model. With this code I can set the label of the SelectBox
> items to the value stored inside the "value" property. The corresponding
> value stored under model is the property object from my list ({key:
> "foo", value: "bar"}).
>
> --snip--
>             var listController = new qx.data.controller.List(itemList,
> formItem, "value");
>             this.__controller.addTarget(listController, "selection[0]",
> item.getBinding(), true);
> --snip--
>
> The question is: How can I bind only the key value of my property object
> to the object controller (line two)? I've tried something like
> "selection[0].key" which not worked... Any ideas?
>
> Thanks in advance - Claus
>
> --
> claus straube
>
>
>
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America
> contest
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in
> marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to