I have a dataservice setup to fill an arraycollection of
Teacher objects. Each Teacher object has a School object. These
appear to be properly returned from FDS as strongly-typed objects.
In the debugger, I can see my arraycollection of Teacher objects
and I can see valid School objects nested inside each one. However,
when I tried to display the data in a datagrid, I cannot get the
properties of the School object nested in the Teacher object to
print out. Here is what I'm trying to do:
<mx:DataGrid id="teachers_datagrid" editable="true"
dataProvider="{teachersArray}">
<mx:columns>
<mx:DataGridColumn dataField="teacherid"
headerText="Teacher Id" editable="false"/>
<mx:DataGridColumn dataField="teachername"
headerText="Teacher Name"/>
<mx:DataGridColumn dataField="school.schoolid"
headerText="School Id"/>
<mx:DataGridColumn dataField="school.schoolname"
headerText="School Name"/>
</mx:columns>
</mx:DataGrid>
For some reason, the school.schoolid and school.schoolname
values will not show up, while the teacherid and teachername appear
correctly. If I just put 'school', I can see the value of the
object represented as a string (ie [Object]). When I look in the
debugger, I see what appears to be a correct arraycollection of
Teachers with valid School properties inside them. Is there some
other way to display the child properties that are complex
objects?