flex 3 combobox selected item
I have a combobox with arrayCollection dataprovider, it has nothing s开发者_运维百科elected after creation. I want to add some text as first option when nothing is selected, just to indicate that the user didn't select an option yet.
If I understood you correctly, prompt
property is what you are looking for. To quote the ComboBox documentation from Flex 3:
The prompt for the ComboBox control. A prompt is a String that is displayed in the TextInput portion of the ComboBox when selectedIndex = -1. It is usually a String like "Select one...". If there is no prompt, the ComboBox control sets selectedIndex to 0 and displays the first item in the dataProvider.
Quote from ComboBox documentation
精彩评论