Here¹s a simple example...
<?xml version="1.0" encoding="utf-8"?> <mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="init()"> <mx:Script> <![CDATA[ import
mx.collections.ArrayCollection; [Bindable] private var
myCollection:ArrayCollection = new ArrayCollection([{label: 'one'}, { label:
'two'}, { label: 'three'}, { label: 'four'}]); public function
getSelectedListItems():void { var theList:List = List(myList);
var selectedItems:Array = theList.selectedItems; for( var i:String in
selectedItems ) { showSelected.text +=
selectedItems[i].label + "\n"; } } ]]> </mx:Script> <mx:List
id="myList" width="200" dataProvider="{myCollection}"
allowMultipleSelection="true"/> <mx:Button label="Show Selected Items"
x="232" y="120" click="getSelectedListItems()"/> <mx:TextArea x="414" y="10"
id="showSelected" width="186" height="132"/> </mx:Application>
On 1/5/07 10:55 AM, "Lisa Lee" <[EMAIL PROTECTED]> wrote:
>
>
>
>
> I hate asking what I think is probably a very stupid question, but
> being so new to Flex, I am still quite wet behind the ears....I have
> an <mx:List> and I have set the "allowMultipleSelection" property to
> true...my question is, how do I determine what selection(s) the user
> has selected, if they're selected more than one?
>
> <mx:Script>
> <![CDATA[
> import mx.controls.List;
> [Bindable] private var serviceTypeTemp:ArrayCollection;
> private function serviceTypeHandler2(event:ResultEvent):void {
> serviceTypeTemp = event.result.serviceTypeData.serviceType;
> }
> ]]>
> </mx:Script>
>
> <mx:HTTPService id="serviceTypeRPC"
>
> url="http://development/dev1/workspaces/lisa/webservicedata/se
> rvicetypedata.xml"
> result="serviceTypeHandler2(event)"/>
>
> <mx:List id="stComboList"
> dataProvider="{serviceTypeTemp}"
> labelField="description"
> allowMultipleSelection="true"/>
>
>
>