Hi,
I publish a WebService using Apache CXF backing a Java App.
This Java application simply serves an array of Person objects:
Person{ id:int, name:String, nationality:Nation }
Nation{ id:int, name:String }
I am trying to list all person records using a DataGrid.
Below is the mxml file. (ws is the WebService variable)
<mx:DataGrid dataProvider="{ws.getProjects.lastResult}"
/>
id and name fields are all well displayed. But nationality is
just "object Object" which makes no sense.
I googled and found some solutions but could not make them
worked. One of the examples were using labelFunction. I tried it
like this:
// script starts here ..
private function lblFunc(item:Object,
column:DataGridColumn):String {
var sLabel:String = "n/a";
var sHeaderText:String = column.headerText;
switch(sHeaderText) {
case "nationality" : sLabel = item.name; break;
default:
sLabel = item.toString();
}
return sLabel;
}
//... some code here
<mx:DataGrid dataProvider="{ws.getProjects.lastResult}"
labelFunction="lblFunc"/>
// some more..
Ok, this also did not worked.
Is there any one who knows how to show nested properties
provided by a web service ?
Thanks,
Selcuk Bozdag