Thanks for the feedback william, it was helpful but it still
not entirely what i want the list box and combo box to do. After
the array has been populated in the list box, a selection of item
can be made to display further details of the item in the list box.
A quick question will be can parallel array type be created in
Flex? Trying to accomplish department phone book. The people can
select the department and it will show the list of people in that
department. In the list box a selection of the person can be made
to display more detailed info about the person as name, phone
number, job title and etc. So far i'm not able to get the connect
between the combo and list box to display detail person info. Need
Help, all suggestions will be greatly appreciated. Here's my code
so far:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"layout="absolute">
<mx:Style>
Panel
{
borderStyle: solid;
headerColors: #e7e7e7, #d9d9d9;
backgroundAlpha: 100;
paddingTop: 10;
}
</mx:Style>
<mx:ArrayCollection id="ITpeople">
<mx:Object>
<mx:image>images/andrewo.gif</mx:image>
<mx:name>John Doe</mx:name>
<mx:title>Weblayout Specialist</mx:title>
<mx:phonenum>ext. 1028</mx:phonenum>
<mx:description>IT Department</mx:description>
</mx:Object>
</mx:ArrayCollection>
<mx:ArrayCollection id="Company">
<mx:Object>
<mx:comp>IT</mx:comp>
</mx:Object>
<mx:Object>
<mx:comp>Accounting</mx:comp>
</mx:Object>
<mx:Object>
<mx:comp>Customer Service</mx:comp>
</mx:Object>
</mx:ArrayCollection>
<mx:Script>
<![CDATA[
import mx.collections.*;
]]>
</mx:Script>
<mx:Panel layout="absolute" left="10" top="10" right="54"
bottom="200" title="ICM Phone Directory">
<mx:ComboBox x="10" y="32" id="cbxCompDept"
dataProvider="{Company}" labelField="comp" selectedIndex="0" >
</mx:ComboBox>
<mx:List id="names" dataProvider="{ITpeople}"
labelField="name" selectedIndex="0" x="10" y="95" height="268"
width="165"></mx:List>
<mx:VBox width="416" y="95" x="206">
<mx:Image id="picture"
source="{ITpeople.getItemAt(names.selectedIndex).image}"
autoLoad="true" />
<mx:Form id="details">
<mx:FormItem label="Name: ">
<mx:Label id="nameInput"
text="{ITpeople.getItemAt(names.selectedIndex).name}"/>
</mx:FormItem>
<mx:FormItem label="Title: ">
<mx:Label id="titleInput"
text="{ITpeople.getItemAt(names.selectedIndex).title}"/>
</mx:FormItem>
<mx:FormItem label="Phone Number: ">
<mx:Label id="phoneInput"
text="{ITpeople.getItemAt(names.selectedIndex).phonenum}"/>
</mx:FormItem>
<mx:FormItem label="Department/Company: ">
<mx:Label id="descInput"
text="{ITpeople.getItemAt(names.selectedIndex).description}"
height="120" width="200" />
</mx:FormItem>
</mx:Form>
</mx:VBox>
</mx:Panel>
</mx:Application>