3

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" />
ketan
  • 19,129
  • 42
  • 60
  • 98
Maurits de Boer
  • 1,907
  • 4
  • 23
  • 30

1 Answers1

4

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

Gregor Kiddie
  • 3,119
  • 1
  • 19
  • 16
  • 2
    That will suffice to show a text label, but if the itemrenderer is more complex (e.g. images, etc) you'll want to take a look at this earlier answer: http://stackoverflow.com/questions/269773/flex-custom-item-renderer-for-the-displayed-item-in-the-combobox/280859#280859 – Rhysyngsun Nov 20 '09 at 15:47