When we are working on ComboBox control in Flex we give a default value to it so that the user using the Control is Prompted with some message. The default value like “select a product” …. something like that for the user Interface to select a value from the list. So to set this we can use a existing property in the ComboBox control called “prompt”.Example is given below.
<mx:ComboBox x=”89″ y=”299″ width=”240″ prompt=”Select Product..” labelField=”@PRO” dataProvider=”{arrColl}” id=”cmbStatus” ></mx:ComboBox>
As you can see the property usage in the control and the dataProvider is the ArrayCollection [An Example].
Enjoy the new Property in ComboBox control. And Enjoy the code.

This image shows the property.


July 28, 2008 at 9:07 pm |
Hello,
Imagine your code with the change on the prompt:
It’s possible use the string “All” as a value if i don´t change anything in the combobox??
Thanks!!
José Carlos Fonseca
FAFE – PORTUGAL
September 16, 2009 at 6:33 am |
But after selecting a product the prompt value ‘Select Product..’ disappears then what to do
September 16, 2009 at 7:01 am |
After selecting a value , that value is highlighted on the Combobox, thats the feature of it., if you want to reset it, then assign -1 as the selectedIndex to the Combobox.
regards,
kumar.