Hi,
The problem can be summarized as when clicking an item in datagrid, the text area shows the value of the item, but here the compoents are separate and hence events need to be dispatched.
My mxml component file :
<?xml version="1.0" encoding="utf-8"?>
<mx:DataGrid xmlns:mx="http://www.adobe.com/2006/mxml" itemClick="itemClickEvent(event);" creationComplete="init()">
<mx:Metadata>
[Event(name="IdSelected", type="one.IdEvent")]
</mx:Metadata>
<mx:Script>
<![CDATA[ import genericReport.*;
import crewUtilization.*;
import utils.*;
import studies.*;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
import mx.events.ListEvent;
private function itemClickEvent(event:ListEvent):void
{
var _study:Object=event.currentTarget.selectedItem.study;
dispatchEvent(new IDEvent(_ID));
}
]]>
</mx:Script>
<mx:columns>
<mx:DataGridColumn dataField="name" />
<mx:DataGridColumn dataField="userId" />
</mx:columns>
</mx:DataGrid>
///////////////////////////////////////////////////////////////
This is my Main MXML Application file :
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:custom="*">
<mx:TitleWindow label="Scenario Creation" xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:ns1="ccCreation.*">
<mx:Label text="CC CREATION" width="100%" />
<mx:VBox width="100 %" styleName="scenariovboxStyle">
<custom:studySelector id="dg" />
</mx:VBox>
</mx:TitleWindow>
</mx:Application>