0

I'm using Qooxdoo 2.0 ComboBox and SelectBox component. I'm looking for a solution to programmatically define the label of each combo entry. Something similar to the labelFunction or labelField properties in the Flex ComboBox *(or spark DropDownList) componenent.

Thanks Davide

Panciz
  • 2,183
  • 2
  • 30
  • 54

2 Answers2

0

I am not quite sure what your looking for but the data binding controller might be the stuff you need. Just check out the following demo [1] which shows a select box bound to an array containing strings. The select boxes can be replaced by combo boxes as well.

[1] http://demo.qooxdoo.org/current/demobrowser/#data~SelectBox.html

Martin Wittemann
  • 2,109
  • 1
  • 12
  • 14
0

I wanted to populate the ComboBox, or SelectBox, with a list ob object with 2 properties, and then set the Combobox to use the first properties as the label and the second one as value.

A the end I used the model property from the the qx.ui.form.ListItem class. to store additional data for each selection.

This is how I populate the ComboBox item.

for(var x in data){
    var tempItem = new qx.ui.form.ListItem(data[x]["name"]);
    tempItem.model=data[x];
    combo.add(tempItem);
}

And this is How I get the additional values from the selection:

combobox.getSelection()[0].model.id

Davide

Panciz
  • 2,183
  • 2
  • 30
  • 54