Avatar of 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: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: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: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:DataGridColumn headerText="Year" dataField="col1"/>
											<mx:DataGridColumn headerText="Proejct" dataField="col2"/>

Open in new window

Apache Flex

Avatar of undefined
Last Comment

8/22/2022 - Mon
Gary Benade

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.

Perfect! This got it done.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck