--- In [email protected], "g_vaccarezza" <[EMAIL PROTECTED]> wrote:
>
> Hi guys:
>
> I got this XML:
>
> <data>
> <speciality>
> <spec number = "1" label = "Especialidad 1"/>
> <spec number = "2" label = "Especialidad 2"/>
> <spec number = "3" label = "Especialidad 3"/>
> <spec number = "4" label = "Especialidad 4"/>
> <spec number = "5" label = "Especialidad 5"/>
> </speciality>
> </data>
>
> And the list:
>
> <mx:List dataProvider="{filterIndex.speciality.spec}" >
>
> I need to make multiple selections in the list and retrieve each
> item's label in order to send a request to a data base.
>
> Using selectedIndices only retrieves items positions.
> If I use selectedItems and the next AS:
>
> trace (selectedItems.toString())
>
> I just get a [Object object] thingy...I can't seem to be able to
> retrieve each item's label...
>
> Any suggestions? DO I need to go a step further and use additional AS
> to solve the problem or is ther a way to get an array of the labels
> directly (something like selectedItems.label)?
>
> Thanks!
> -G
>Hello,

Try the following little snippet:

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[

public function changeEvt(event:flash.events.Event):void
{
for (var i:Number = 0; i <= event.currentTarget.selectedIndices.length; i++)  {
 
forChange.text+=event.currentTarget.selectedItems[i].label + "\n";
}


}
]]>
</mx:Script>
<mx:List width="135" change="changeEvt(event)" allowMultipleSelection="true">
<mx:Object label="Especialidad_1" data=""/>
<mx:Object label="Especialidad_2" data=""/>
<mx:Object label="Especialidad_3" data=""/>
</mx:List>
<mx:TextArea id="forChange" height="200" width="150"/>
</mx:Application>

good luck, Bela

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to