Groups | Blog | Home
all groups > coldfusion flash integration > may 2006 >

coldfusion flash integration : Calling a fuction from a response Handler


billdimit
5/4/2006 2:18:20 AM
I use a function with remote call to populate a grid with data and it works
fine.
function getStudentAll() {
<cfoutput> var connection:mx.remoting.Connection =
mx.remoting.NetServices.createGatewayConnection(
"http://#cgi.HTTP_HOST#/flashservices/gateway/");
var myService:mx.remoting.NetServiceProxy; </cfoutput> var
responseHandler1:Object = {};
var approved:mx.controls.DataGrid = studentGrid;
responseHandler1.onResult = function( results: Object ):Void {
approved.dataProvider = results;
}
responseHandler1.onStatus = function( stat: Object ):Void {
alert("Error while calling cfc:" + stat.description);
}
myService =
connection.getService("<cfoutput>#Application.comp#</cfoutput>.student",
responseHandler1 );
myService.getStudent();
}
Pressing another button I change a value in one column and I need to reload
data into the student grid. I've tried to call previous function from the
response Handler in the second function but it doesn't work. I don't know why.
The call doesn't even enter the getStudentAll function.

function acceptStudent() {
var studId = studentGrid.selectedItem.studId;
_root.messageStudent.text='';
<cfoutput> var connection:mx.remoting.Connection =
mx.remoting.NetServices.createGatewayConnection(
"http://#cgi.HTTP_HOST#/flashservices/gateway/");
var myService:mx.remoting.NetServiceProxy; </cfoutput> var
responseHandler1:Object = {};
var approved:mx.controls.DataGrid = studentHistory;
responseHandler1.onResult = function( results: Number ):Void {
getStudentAll();
}
responseHandler1.onStatus = function( stat: Object ):Void {
alert("Error while calling cfc:" + stat.description);
}
myService =
connection.getService("<cfoutput>#Application.comp#</cfoutput>.student",
responseHandler1 );
myService.acceptStudent(studId);
}
_silence
5/4/2006 7:03:20 PM
try:

_silence
5/4/2006 7:03:24 PM
try:

billdimit
5/5/2006 1:12:58 AM
Thanks.
It's solved the problem.
AddThis Social Bookmark Button