I have the following code. The logger shows that the connection to the remote
service t is successful. If I dump the results of the CFC I get the data I'm
looking for. I haven't done this in a while. Any ideas on why I'm not getting
results in the datagrid?
Thanks.
//Import Stuff
import mx.remoting.*;
import mx.rpc.*;
import mx.services.Log;
//Data type the components
var name_txt:mx.controls.TextArea;
var myGrid_dg:mx.controls.DataGrid;
//Remoting Stuff
mx.remoting.debug.NetDebug.initialize();
var myLogger:Log = new Log( Log.DEBUG, "logger1" );
//override the default log handler
myLogger.onLog = function(message:String):Void{
trace("myLogger: " + message);
}
//Create the service
myService = new
Service("http://localhost/flashservices/gateway",myLogger,"Phonebook.CFC.phoneDa
ta",null,null);
//Hander for results
function onGetData(msg:ResultEvent){
mx.remoting.debug.NetDebug.trace({level:"Debug",message:"onGetData" });
myGrid_dg.dataProvider = msg;
}
//Handler for errors
function onDataFault(rs: FaultEvent){
mx.remoting.debug.NetDebug.trace({level:"None", message:"Oops!: " +
fault.fault.faultstring });
}
var pc:PendingCall = myService.getNetworkUsers;
pc.responder = new RelayResponder(this._parent, "onGetData", "onDataFault");
lazures - 17 Apr 2007 17:45 GMT
cyberluna - 18 Apr 2007 20:33 GMT
Perhaps you should be taking the data into a RecordSet object which is displayed by the datagrid very easily.