I would like to do statistics in flex. I have recuperated my array list from the java service when i clicked on a button and i recuperate the end and finish date of statistics when i test the return values of the list in java it gives the correct the result but in flex the datagrid is not filled.
This is the method in flex:
[Bindable]
private var FinalResult:ArrayCollection = new ArrayCollection();
private function getTicketByStatus(evt:ResultEvent):void
{
FinalResult= evt.result as ArrayCollection;
dg.dataProvider=FinalResult;
}
protected function buttnSta_clickHandler(event:MouseEvent):void
{
startDate=StartDateField.selectedDate;
endDate=EndDateField.selectedDate;
CountTicketsByStatusResult.token = ticketServiceImpl.CountTicketsByStatus(startDate,endDate);
FinalResult=CountTicketsByStatusResult.lastResult;
dg.dataProvider=FinalResult;
for(var i=0;i<FinalResult.length;i++)
{
Alert.show("element"+FinalResult.length.toString());
}
}
<mx:DataGrid id="dg" x="306" y="91" width="354" height="208" dataProvider="{FinalResult}">