Anthony_Harris
asked on
Flex 3 / Actionscript How do I populate employee record form when datagrid element is selected?
I am redesigning a homegrown ERP/cost management system based in Access to run in MySQL with a Flex designed front end. My question is this: I have a tab based interface with sub-tabs. One is "HR Functions." I used the application generator to create a datagrid that displays employeeID, last name, and first name from the employee table. I have several other tabs in the HR section such as an employee information form, work history, assignment information, etc, that pull from 3 different tables. I want to use the if(dataGrid.selectedItem) statement to control what is displayed throughout the HR section. For instance, if I find my employee id and highlight it in the datagrid, I want the employee informatino form to populate with all of my information in the employee info tab. Any help on this is greatly appreciated.
<mx:Canvas label="Tabs" width="100%" height="100%">
<mx:TabNavigator x="0" y="0" width="1023" height="683">
<mx:Canvas label="Employee Information" width="100%" height="100%">
<mx:Panel x="10" y="0" width="827" height="273" layout="absolute" title="Employee Information" id="empinfoform0" borderColor="#212B8E">
<mx:Image x="0" y="0" width="80" height="79"/>
</mx:Panel>
</mx:Canvas>
<mx:Canvas label="Employee Chooser" width="100%" height="100%">
<mx:Panel width="470" height="381" layout="absolute" id="empsearchbox0" title="Select an Employee" y="10" x="10" borderColor="#212B8E">
<comps:ShortEmps id="ShortEmps1" label="Short Emps" x="27.5" y="35"/>
</mx:Panel>
</mx:Canvas>
<mx:Canvas label="Contract Information" width="100%" height="100%">
<mx:Panel x="10" y="10" width="349" height="203" layout="absolute" title="Contract Information" id="contractPanel" borderColor="#212B8E">
<mx:Label x="10" y="10" text="Current Project" id="curproj"/>
<mx:Label x="10" y="36" text="Shift" id="shiftlbl"/>
<mx:Label x="10" y="62" text="Status" id="statuslbl"/>
<mx:Label x="15" y="88" text="Craft" id="craftlbl"/>
<mx:ComboBox x="126" y="8"></mx:ComboBox>
<mx:ComboBox x="126" y="86"></mx:ComboBox>
<mx:Label x="15" y="114" text="Project Wage" id="wagelbl"/>
<mx:Label x="15" y="135" text="Per Diem" id="perdiemlbl"/>
<mx:TextInput x="126" y="112"/>
<mx:TextInput x="126" y="133"/>
<mx:RadioButtonGroup id="radiogroup1"/>
</mx:Panel>
</mx:Canvas>
<mx:Canvas label="Employment History" width="100%" height="100%">
<mx:Panel x="10" y="10" width="476" height="272" layout="absolute" borderColor="#212B8E" id="emphistpane" title="Employment History">
<mx:DataGrid x="10" y="0" height="222" width="427">
<mx:columns>
<mx:DataGridColumn headerText="Year" dataField="col1"/>
<mx:DataGridColumn headerText="Proejct" dataField="col2"/>
</mx:columns>
</mx:DataGrid>
</mx:Panel>
</mx:Canvas>
</mx:TabNavigator>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER