I am using FlashBuilder 4.5 for PHP. I have a simple MySQL table with the fields {tID, tName}.
I am able to populate a DropDownList in a Flex form as below. The DropDownList shows the name of the people without problem:
<s:Form defaultButton="{button}">
<s:FormItem label="myList: ">
<s:DropDownList id="dropDownList" creationComplete="dropDownList_creationCompleteHandler(event)" >
<s:AsyncListView list="{getPeopleResult.lastResult}"/>
</s:DropDownList>
</s:FormItem>
<s:Button id="button" label="Submit"click="button_clickHandler(event)"/>
</s:Form>
In my button_clickHandler function, I want to obtain the ID of the selected item from the dropdownlist:
protected function button_clickHandler(event:MouseEvent):void
{
person.tID=dropDownList.selectedItem as int;
createpersonResult.token=personservice.createperson(person);
}
The above does not work. I would appreciate any help!