Hi All,
I'm more of a designer than a developer, and as such my coding skills
are not outstanding, so bear with me.
I have an application with custom components inside a viewstack. In one
component I have a datagrid and I would like to have data from the
selected row of the datagrid populate text fields in a separate
viewstack child, and I can't seem to get this to work.
Here is the viewstack (edited to show just the relevant sections):
<mx:ViewStack x="0" y="71" id="viewstackMain" width="100%"
height="100%">
<mx:Canvas label="ViewAssurance" width="100%" height="100%"
id="ViewAssurance">
<mx:Image x="0" y="0" source="images/banner.gif"
width="1003"/>
<mx:Label x="10" y="0" text="Assurance Tests"
fontFamily="Verdana"
fontWeight="bold" fontSize="11" color="#ffffff"/>
<mx:Label x="235" y="0" text="Summary"
fontFamily="Verdana" fontWeight="bold" fontSize="11"
color="#ffffff"/>
<at:assuranceQueryForm x="0" y="19" />
<at:assuranceTestResults x="225" y="20" />
</mx:Canvas>
<mx:Canvas label="ViewAssuranceTest" width="100%" height="100%"
id="ViewAssuranceTest" buttonMode="true" >
<mx:Canvas x="192" y="38" width="774" height="100"
backgroundColor="#dddddd" borderStyle="solid"
borderColor="#bbbbbb" cornerRadius="8"
id="cvsATGeneral">
<mx:Label x="10" y="10" text="Name:"/>
<mx:Text x="82" y="37" text="" id="txtATDetailsName"/>
<mx:Label x="10" y="37" text="Description:"/>
<mx:Text x="82" y="10" text="" id="txtATDetailsDesc"/>
</mx:Canvas>
<mx:Label x="207" y="29" text="General" fontFamily="Arial"
fontWeight="bold" fontSize="11" color="#000099"/>
<at:assurenceTestDetails x="192" y="150"
id="assurenceTestDetails"/>
</mx:Canvas>
</mx:ViewStack>
The datagrid is in the component instantiated in the "ViewAssurance"
viewstack child at <at:assuranceTestResults x="225" y="20" />, and the
datagrid code is here:
<mx:DataGrid x="10" y="35" width="765" height="258" rowHeight="18"
headerColors="[#ed8e5f, #ed8e5f]" headerHeight="20"
borderColor="#666666"
id="dgAssuranceResults" selectedIndex="0" wordWrap="false"
alternatingItemColors="[#dddddd,#cccccc]" textAlign="left"
dataProvider="{assuranceTestsXML.item}" >
<mx:columns>
<mx:DataGridColumn headerText="Task Name"
dataField="taskName" width="250"
headerRenderer="comps.cmpHeaderRenderer"/>
<mx:DataGridColumn headerText="Enabled" sortable="false"
width="70"
editable="true" rendererIsEditor="true"
headerRenderer="comps.cmpHeaderRenderer"
itemRenderer="comps.ckbxAssurRenderer"/>
<mx:DataGridColumn headerText="Frequency"
dataField="frequency"
headerRenderer="comps.cmpHeaderRenderer"/>
<mx:DataGridColumn headerText="Last Run" dataField="lastRun"
headerRenderer="comps.cmpHeaderRenderer"/>
<mx:DataGridColumn headerText="Next Run" dataField="nextRun"
headerRenderer="comps.cmpHeaderRenderer"/>
<mx:DataGridColumn headerText="Task Running"
sortable="false" width="100"
editable="true" rendererIsEditor="true"
headerRenderer="comps.cmpHeaderRenderer"
itemRenderer="comps.checkboxRenderer"/>
</mx:columns>
</mx:DataGrid>
If they were part of the same file I would use something like:
<mx:Text x="82" y="37" text="{dgAssuranceResults.selectedItem.taskName}"
id="txtATDetailsName"/>
but I need a more explicit path between the two. I've tried
"Application.application.viewstackMain..etc,etc," but whatever
combinations I try don't work.
What am I missing here?
Thanks,
Jack