Setting an array to results from remoteObject
using debugger in flex builder 2 see myremoteobject returns data. see alert.result returns array full of data. listener gets called , set breakpoint in procedure (reportreceived) , can see alert.result array. reports.source null after set equal alert.result. again alert.result has data.
what doing wrong?
<?xml version="1.0" encoding="utf-8"?>
<mx:application xmlns:mx=" http://www.adobe.com/2006/mxml"
layout="absolute"
applicationcomplete="setup()">
<mx:script>
<![cdata[
import mx.controls.alert;
import mx.collections.*;
import mx.rpc.events.*;
import mx.events.*;
import mx.utils.*;
[bindable]
private var reports:arraycollection = null;
private function setup():void {
myremoteobject.getreportsall.send();
}
private function reportreceived(event:resultevent):void {
reports = new arraycollection();
reports.source = event.result array;
reportinspector();
}
private function reportinspector():void {
var temp:array = new array();
temp[0] = reports.length;
}
]]>
</mx:script>
<mx:remoteobject
id="myremoteobject"
destination="coldfusion"
showbusycursor="true"
source="flex.dashboard.flashremotingresponder"
fault="alert.show(event.fault.faultstring, 'error');">
<mx:method name="getreportsall"
result="reportreceived(event)"/>
<!-- <mx:method name="addreports" result="reportsaved(event)"/>
<mx:method name="deletereports" result="reportdeleted(event)"/> -->
</mx:remoteobject> text
this leads me suspect event.result not array. "as" operator return null if can't perform cast. sure debugger shows type of event.result being array?
More discussions in Flex (Read Only)
adobe
Comments
Post a Comment