We help IT Professionals succeed at work.

Flex 3 / Actionscript How do I populate employee record form when datagrid element is selected?

Last Modified: 2010-04-21
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

Watch Question

This one is on us!
(Get your first solution completely free - no credit card required)


Perfect! This got it done.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.