coldfusion flash integration:
I want to refresh/reload a CFGRID after I perform an update, how would I go
about doing this?
here is the action script code I'm using below, can anyone provide the code
for me to do this or just modify the one below because I'm having a tuff time
getting this to work, I also tried getting some tips for the here
(
http://tutorial127.easycfm.com/) but I guess I just don't get it.
<cfsavecontent variable="updLocation">
if (loc_nameB.text == '')
{
mx.controls.Alert.show('location Name is required!');
}
else if (loc_addressB.text == '')
{
mx.controls.Alert.show('location Address is required!');
}
else if (loc_cityB.text == '')
{
mx.controls.Alert.show('location City is required!');
}
else if (loc_stateB.text == '')
{
mx.controls.Alert.show('location State is required!');
}
else if (loc_zipcodeB.text == '')
{
mx.controls.Alert.show('location Zipcode is required!');
}
else if (loc_phoneB.text == '')
{
mx.controls.Alert.show('location Tel.Number is required!');
}
else if (loc_managerB.text == '')
{
mx.controls.Alert.show('location Manager is required!');
}
else if (loc_hoursB.text == '')
{
mx.controls.Alert.show('location Hours are required!');
}
else
{
//create connection, replacing the gateway url with yours
var connection:mx.remoting.Connection =
mx.remoting.NetServices.createGatewayConnection("http://<cfoutput>#cgi.HTTP_HOST
#</cfoutput>/flashservices/gateway/");
//declare service
var myService:mx.remoting.NetServiceProxy;
//put the controls in scope to avoid calling _root
var locid = locdata.selectedItem.locid;
var loc_name = loc_nameB.text;
var loc_address = loc_addressB.text;
var loc_city = loc_cityB.text;
var loc_state = loc_stateB.text;
var loc_zipcode = loc_zipcodeB.text;
var loc_phone = loc_phoneB.text;
var loc_manager = loc_managerB.text;
var loc_hours = loc_hoursB.text;
//make an object that will handle the response
var responseHandler = {};
//function that receives the response
responseHandler.onResult = function( results: String ):Void {
//when results are back, we show the text received
mx.controls.Alert.show(String(results));
}
//function that receives any error that may have occurred during the call
responseHandler.onStatus = function( stat: Object ):Void {
//if there is any error, show an alert
alert("Error while calling cfc:" + stat.description);
}
myService = connection.getService("otgadmin.cfc.locationsCom",
responseHandler );
//make call, passing one parameter
myService.updLoc(locid,loc_name,loc_address,loc_city,loc_state,loc_zipcode,loc_p
hone,loc_manager,loc_hours);
}
</cfsavecontent>