Hi, It turns out that there is a problem with my remote object (I think), because after I make the call, this function is executed. I know this one is executed because I did a Alert.show('test') within this function and it does the alert so this function must be getting called after I try to make a remote object call.
// this is called when the delegate receives a fault from the service public function fault( rpcEvent : Object ) : void { model.errorStatus = "Fault occured in LoadEmployeesCommand."; } I am thinking it may not be finding my CFC, butI am not sure, I just know its not calling the "result" function, its calling the "fault" function. Any help appreciated --- In flexcoders@yahoogroups.com, "malik_robinson" <[EMAIL PROTECTED]> wrote: > > > Hi, > > I am trying to learn to use Cairngorm and I am trying to find out where > I am going wrong. I have a CFC which I am trying to call and get a > string back for testing to make sure its all working. The delegate > should call the result or the fault function in my LoginUserCommand if I > am correct. I am trying to see if the problem is the call to the CFC or > the problem is in my LoginUserCommand which has functions that should > handle the result or a fault. > > I have this in my "LoginUserDelegate" > > package com.adobe.myApp.business { > > > > > > import mx.rpc.AsyncToken; > > > > import mx.rpc.IResponder; > > import com.adobe.cairngorm.business.ServiceLocator; > > import mx.controls.Alert; > > > > public class LoginUserDelegate { > > > > private var command : IResponder; > > private var service : Object; > > > > public function LoginUserDelegate( command : IResponder ) { > > > > this.service = ServiceLocator.getInstance().getService( > 'loginUserService' ); > > > > this.command = command; > > } > > > > public function loginUserService() : void { > > > > > > var token:AsyncToken = service.send(); > > > > token.addResponder( command ); > > } > > } > > } > > My services.xml: > > <?xml version="1.0" encoding="utf-8"?> > > <cairngorm:ServiceLocator > > xmlns:mx="http://www.adobe.com/2006/mxml" > > xmlns:cairngorm="com.adobe.cairngorm.business.*"> > > > > <mx:RemoteObject > > id="loginUserService" > > destination="Coldfusion" > > source="cf.com.User" > > showBusyCursor="true" > > > <mx:method name="sayHelloString" /> > > > > </mx:RemoteObject> > > > > Then I have a "LoginUserCommand": > > package com.adobe.myApp.command { > > > > > > import mx.rpc.IResponder; > > > > import com.adobe.cairngorm.commands.Command; > > import com.adobe.cairngorm.control.CairngormEvent; > > import com.adobe.myApp.business.LoginUserDelegate; > > import com.adobe.myApp.model.AppModelLocator; > > > > public class LoginUserCommand implements Command, IResponder { > > > > private var model : AppModelLocator = AppModelLocator.getInstance(); > > > > public function execute( loginEvent:CairngormEvent ) : void { > > > > > var delegate : LoginUserDelegate = new LoginUserDelegate( this ); > > > > > > > delegate.loginUserService(); > > } > > > > // this is called when the delegate receives a result from the service > > public function result( rpcEvent : Object ) : void { > > > > trace(rpcEvent.result); > > > > > > } > > > > > > public function fault( rpcEvent : Object ) : void { > > model.errorStatus = "Fault occured in LoadEmployeesCommand."; > > } > > } > > } > > > > > > > > > > > > </cairngorm:ServiceLocator> >