Hi,
the problem is in the label binding. Make sure to keep the two lines in the
bindItem function:
controller.bindProperty("label", "label", null, item,
index);
controller.bindProperty("key", "model", null, item,
index);
On Thu, Oct 21, 2010 at 6:23 AM, Claus Straube <[email protected]>wrote:
> Hi,
>
> thank you for your reply. I also tried your version, but fails with an
> error:
> 001781 Assertion error! Invalid incoming value for property 'label' of
> class 'qx.ui.basic.Atom': Expected value to be a string but found
> qx.data.model.key"value[59]!
>
> I've no idea why he get's here the object and not the 'value'... Perhaps
> this is the problem: He puts for this line of code
> --snip--
> controller.bindProperty("key", "model", null, item, index);
> --snip--
> the property object into the model property as well? Of course model will
> accept complex objects.
>
> That's really tricky. Any ideas to solve this? Thank you in advance.
>
> Claus
>
> On 20.10.2010 19:32, Guilherme Aiolfi wrote:
>
> 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
> [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
>
>
------------------------------------------------------------------------------
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