Two (2) column ListItem for SelectBox

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Two (2) column ListItem for SelectBox

Tom Saddul
Been trying to find an example of how to create a ListItem with two (2) columns for a SelectBox control but my search and trials are so far in vain.  I have seen the ComboTable contrib but I just need to be able to add an item (string array) to a SelectBox like below:

                    var selectBox = new qx.ui.form.SelectBox();
                    selectBox.add(new CustomListItem(["Item 0,0", "Item 1,0"]));  // add first row
                    selectBox.add(new CustomListItem(["Item 1,1", "Item 1,1"]));  // add another row

Any help is greatly appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: Two (2) column ListItem for SelectBox

MartinWittemann
Administrator
Hey,

just took a look at the infrastructure and have a idea how I would get that done.

You need a custom list item which could extend from list item but you can not change the original label property as this is defined as a String and not an array of strings. So either you add a second property and use that or you don’t extend from list item and create your own.
But the select box requests some API to be existing like getLabel, getIcon and getRich. Make sure you have these API on your custom widget to make it work.

Regards,
Martin

> Am 26.03.2015 um 17:56 schrieb Tom Saddul <[hidden email]>:
>
> Been trying to find an example of how to create a ListItem with two (2)
> columns for a SelectBox control but my search and trials are so far in vain.
> I have seen the ComboTable contrib but I just need to be able to add an item
> (string array) to a SelectBox like below:
>
>                    var selectBox = new qx.ui.form.SelectBox();
>                    selectBox.add(new CustomListItem(["Item 0,0", "Item
> 1,0"]));  // add first row
>                    selectBox.add(new CustomListItem(["Item 1,1", "Item
> 1,1"]));  // add another row
>
> Any help is greatly appreciated.
>
>
>
> --
> View this message in context: http://qooxdoo.678.n2.nabble.com/Two-2-column-ListItem-for-SelectBox-tp7586987.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Two (2) column ListItem for SelectBox

fritz
How about using setUserData on the list items as a work around?

Cheers,
Fritz

On Fri, 27 Mar 2015, Martin Wittemann wrote:

> just took a look at the infrastructure and have a idea how I would get that done.
>
> You need a custom list item which could extend from list item but you can not change the original label property as this is defined as a String and not an array of strings. So either you add a second property and use that or you don?t extend from list item and create your own.
> But the select box requests some API to be existing like getLabel, getIcon and getRich. Make sure you have these API on your custom widget to make it work.
>
> Regards,
> Martin
>
>> Am 26.03.2015 um 17:56 schrieb Tom Saddul <[hidden email]>:
>>
>> Been trying to find an example of how to create a ListItem with two (2)
>> columns for a SelectBox control but my search and trials are so far in vain.
>> I have seen the ComboTable contrib but I just need to be able to add an item
>> (string array) to a SelectBox like below:
>>
>>                    var selectBox = new qx.ui.form.SelectBox();
>>                    selectBox.add(new CustomListItem(["Item 0,0", "Item
>> 1,0"]));  // add first row
>>                    selectBox.add(new CustomListItem(["Item 1,1", "Item
>> 1,1"]));  // add another row
>>
>> Any help is greatly appreciated.

--
Oetiker+Partner AG              tel: +41 62 775 9903 (direct)
Fritz Zaucker                        +41 62 775 9900 (switch board)
Aarweg 15                            +41 79 675 0630 (mobile)
CH-4600 Olten                   fax: +41 62 775 9905
Schweiz                         web: www.oetiker.ch

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Two (2) column ListItem for SelectBox

Tom Saddul
In reply to this post by MartinWittemann
Thank you.  Indeed I'm having problem with getIcon, getLabel, etc.. when I tried to make my own ListItem based on the original ListItem.  Will have to try again.