That was helpful! However when I look at the documentation and your 
code, the following seems to be the case:
So help me understand the difference between the label and the model. 
Moreover, the model can be managed but the label can only be set when 
the constructor is called?

Following one of the examples, I was doing this:

selbx.add(new qx.ui.form.ListItem("Foo"));
selbx.add(new qx.ui.form.ListItem("Bar"));
selbx.add(new qx.ui.form.ListItem("For Good"));

This essentially becomes useless without seeing the model property. 
Also, if the label is specified like this where is it stored? there is 
no label property, yet it does show up in the select box drop down.

Do you understand the source of my confusion? If my interpretation of 
the docs and your example is correct then it does not really make sense 
that the value can be manipulated but the label cannot, does it?

Jared



Petr Kobalíček wrote:
> Hi,
>
> I will probably not help you, but I can try to explain some things.
> ListItem is also widget so you are interesting in it. There is no
> value property in ListItem, but there is model property that has
> exactly same function, so if you want to get database id or something
> you can do it this way:
>
> var item = new qx.ui.form.ListItem();
> item.setModel("MyId");
>
> ...
>
> var list = ... // your list
> var sel = list.getSelection(); // selection
>
> // detect if selection contains something
> if (sel.length)
> {
>   var item = sel[0];
>   alert(item.getModel()); // should alert MyId if it's our item
> }
>
> I think that most important for you is model property and it's what you need:)
>
>   

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to