Search code examples
apache-flexcomboboxflex3itemrenderer

Flex3 Combobox doesn't display itemRenderer when closed


I have a combobox with a custom itemRenderer. The ItemRenderer displays some images and a label. When the combobox opens, the items in the dropdown list display perfectly, but when its closed, the combobox doesn't use the ItemRendere, but shows "[object MyItem]". Do I need another attribute to indicate that the ItemRender also needs to be used when closed?

This is my tag:

<mx:ComboBox dataProvider="{myItems}" id="itemsCombo" itemRenderer="org.test.myComboBoxItemRenderer" />

Solution

  • you need to set the labelField or labelFunction property on the combobox to show the same thing as your itemrenderer.