Share on Google+Share on Google+

DropDownList in Flex4

Advertisement
The DropDownList control contains a drop-down list. You can select only one item at a time. Its functionality is very similar to that of the SELECT form element in HTML.

DropDownList control in Flex4:

The DropDownList control contains a drop-down list. You can select only one item at a time. Its functionality is very similar to that of the SELECT form element in HTML. The DropDownList control consists of three things: anchor button, prompt area, and drop-down-list. You can provide the data to the DropDownList control by using the DataProvider(<s:dataprovider/>) Property. The DropDownList control same as the ComboBox control.
The tag of DropDownList control is <s:DropDownList>.

Example:

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark"

xmlns:mx="library://ns.adobe.com/flex/mx">

<s:Panel title="DropDownLlist control" width="268" height="209" color="#990000">

<s:HGroup x="49" y="12" paddingLeft="5" paddingTop="5" width="162">

<s:VGroup>

<s:Label text="Select Color:"/>

<s:DropDownList width="150" id="drp" rollOverColor="#02070F">

<s:ArrayCollection>

<fx:String>Red</fx:String>

<fx:String>Green</fx:String>

<fx:String>Blue</fx:String>

<fx:String>Yellow</fx:String>

</s:ArrayCollection>

</s:DropDownList>

</s:VGroup>

</s:HGroup>

</s:Panel>

</s:Application>

Output:

Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

Download this code

Advertisements

Posted on: May 11, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.