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); }
Thanks. It's solved the problem.
Don't see what you're looking for? Try a search.
|