prompt in ComboBox control in Flex.

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.

prompt property in ComboBox control in Flex.

This image shows the property.

3 Responses to “prompt in ComboBox control in Flex.”

  1. José Carlos Fonseca Says:

    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

  2. manish Says:

    But after selecting a product the prompt value ‘Select Product..’ disappears then what to do

    • kumargandhi Says:

      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.

Leave a Reply