Total Pageviews


Apply AutoComplete component in Flex

Go to here to download AutoComplete Component:

After you download its zip file, extract it and you can find out AdvancedAutoComplete-1.0.swc in bin directory.

Add SWC file into Flex Build Path

Create a value object, which called "People".
This value object contains three attributes, including name, gender and mail.

package vo
public class People
public function People(iName:String, iGender:String, iMail:String)
name = iName;
gender = iGender;
mail = iMail;
public var name:String;
public var gender:String;
public var mail:String;


Create a new MXML Application file, which called "AutocompleteTest".
Click "Finish"

Add a new namespace for this AutoComplete Component

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=""
layout="absolute" >

Declare an ArrayCollection variable for AutoComplete component as its data provider.
And add value object, People, into this ArrayCollection as page load.
Use AutoComplete tag to realize auto complete function.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=""
layout="absolute" initialize="init()">
import vo.People;
import mx.collections.ArrayCollection;

//declare an ArrayCollection as AutoComplete component's data provider
private var peopleList:ArrayCollection = new ArrayCollection();

//set data into people list as page load
private function init():void{
peopleList.addItem(new People("Albert", "Male", ""));
peopleList.addItem(new People("Mandy", "Female", ""));
peopleList.addItem(new People("Verio", "Male", ""));
peopleList.addItem(new People("Richard", "Male", ""));
peopleList.addItem(new People("Andrew", "Male", ""));
<mx:Label text="Name" />
<components:AutoComplete id="autoComplete" labelField="name" dataProvider="{peopleList}" />


As I type in "A", it will show some options for me to select.

As I select "Albert", then it will show my selection in the text field.




Access Net Web Services From Java

Check out this SlideShare Presentation: