You almost got it: *http://tinyurl.com/26k5rxt*
I just changed that line: var listController = new
qx.data.controller.List(listItems.getBar(), select, "value");
:)
On Thu, Oct 21, 2010 at 9:31 AM, Claus Straube <[email protected]>wrote:
> Hi,
>
> yes, I understood that. I've created two samples on playground. This is the
> first one with two lines in delegate. I would assume, that the label and
> model would be set with a single value. But an error occurs, that an object
> has been passed.
>
> http://tinyurl.com/2coz4m7
>
> The second one has one line* *in the delegate section, but should work as
> well. If you change the select box on the left you will see that the model
> has been changed. Not with a single value (the 'key' value) but with the
> whole object (this fits with error sample one throws).
>
> http://tinyurl.com/34llx44
>
> For me this looks like a bug - the line "controller.bindProperty("key",
> "model", null, item, index)" should only pass / bind the value of 'key',
> but passes the whole object. Or do I something wrong? Thank you.
>
> Claus
>
>
> On 21.10.2010 12:53, Guilherme Aiolfi wrote:
>
> 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
> [email protected]https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
> --
> 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