Again, thanks for you reply, that was extremely helpful!!
OK, I did empirically determine how this works. OK, I get what qooxdoo
is trying to do here and I am all for consistency but come on...there
has got to be a point at which common sense takes over?
Since the SelectBox widget can only ever have a single value selected,
shouldn't the SelectBox object override getSelection() such that it
returns a single value only and not always a one element array?
Also, what is with calling a data value "Model" that isn't making much
sense to me either.
Additionally, making clear in the documentation the distinction between
a 'label' and the model property would be helpful. I suitable default
behavior like initializing the model to the label value upon creation
would also make an immense amount of sense, no?!
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