Prompt Property on Spark Combox Component in Flex 4
It appears there is no prompt property for the spark Combobox com开发者_如何学Cponent as there was with the mx version. Anyone have a simple workaround for this or know something I'm just absentmindedly overlooking? Thanks in advance.
There are now two 'combobox' like components in Spark, fx:Combobox and fx:DropDownList. DropDownList has a prompt component and behaves quite a bit like the old flex 3 combobox. I think you'll just need to switch components and you should be able to set a prompt.
http://help.adobe.com/en_US/flex/using/WSc2368ca491e3ff92-59bf082612135c9e688-7fff.html
To solve this problem, just add this property to the s.ComboBox:
selectedItem="{{label:'- Select One-'}}"
with this solution you can have a prompt without adding any row to your dataProvider
精彩评论