Groups > Multimedia > Macromedia rich int apps > Re: multi selection List




multi selection List

multi selection List
Mon, 15 May 2006 18:42:02 +000
Hello Everybody,

 I have a list with multiselection="true"
 Is there a simple way to select all items of my list by coding?
 I beleave that I must use selectedItems property to set an Array of all my 
items. But how?

 Thanks in advance

 FredFlex

Post Reply
Re: multi selection List
Mon, 15 May 2006 21:42:29 +000
will selectedItems not be set as an array already?

 if you're looking to iterate through an array then you need to look up using 
the for syntax which will let you execute a command on each member of the 
array, google is your friend.
Post Reply
Re: multi selection List
Tue, 16 May 2006 16:24:40 -070
Fred,

The dataProvider that you used to populate your List should have all this 
information already.

-- 
Jason Szeto
Adobe Flex SDK Developer

"FredFlex" <webforumsuser@macromedia.com> wrote in message 
news:e4ai1q$3t$1@forums.macromedia.com...
> Hello Everybody,
>
> I have a list with multiselection="true"
> Is there a simple way to select all items of my list by coding?
> I beleave that I must use selectedItems property to set an Array of all my
> items. But how?
>
> Thanks in advance
>
> FredFlex
>
> 

Post Reply
Re: multi selection List
Mon, 22 May 2006 13:12:21 +000
Thanks for yours replys but It doesn't work fine. When I click on Sel All 
button only one item is selected and the other are deleted.
 Here is the code:

 <?xml version="1.0" encoding="utf-8"?>
 <mx: Application xmlns:mx="<a target=_blank
class=ftalternatingbarlinklarge 
href="http://www.adobe.com/2006/mxml"">http://www.adobe.com/20
06/mxml"</a> 
height="100%" width="100%">
 		
 	<mx: Panel title="Filtre Connexions" width="100%"
height="50%">
 		<mx:VBox width="100%">					
 			<mx:List id="lst" width="100%"
 				dataProvider="" 
 				allowMultipleSelection="true"/>
 			<mx:ControlBar>
 				<mx:Button label="Sel. All"
click="onClic_bp_SelAll(event)"/>
 			</mx:ControlBar>
 		</mx:VBox>
 	</mx: Panel>
 	
 	<mx:Script>
 		<![CDATA[
 		
 import mx.controls.List;
 		[Bindable]
 		public var dp: Array = ["ONE","TWO","TREE"];
 			
 		private function onClic_bp_SelAll(e : Event):void
 		{
 			lst.selectedItems = dp;
 		}
 		]]>
 	</mx:Script>
 </mx: Application>
 	

 I don't understand what is the probem. Thank for your support.
Post Reply
about | contact