Hi, I'm trying to call a cfc and put the results into a bindable public var and use that on the page. But the problem is that when I call the method on the cfc, it doesn't put the value into the var immediately as expected... Here's the code, maybe that'll be more helpful:
 
 
<mx:RemoteObject id="cfSrvc" destination="ColdFusion"
     source="flexapps.new.viva.components.model.Record"
     showBusyCursor="true">
  <mx:method name="init" result="initRecord(event)" />
 </mx:RemoteObject>
 
 
 <mx:Script>
  <![CDATA[
   import mx.rpc.events.ResultEvent;
 
   [Bindable]
   public var recordID = 0;

   public function initRecord(event:ResultEvent):void {
    var record = event.result;
    recordID = record.recordID;
    trace('initRecord method: ' + recordID);
   }
 
   public function addRecord():void {
    cfSrvc.init();
    trace('addRecord method: ' + recordID);
   }
 
 
 
Logically I'd think what should happen here is that when addRecord() is invoked, the init() method on the cfc should be invoked, then the value from the cfc is inserted into the recordID var and then the process continues... But instead, the init() method is getting invoked, the addRecord() method is completing before the values from the initRecord bind to the var.
 
Here's the trace results
addRecord method: 0 // <---- This should not be before initRecord since this trace logically comes afterwards because cfSrvc.init() invokes initRecord()...
initRecord method: n
 
 
What am I missing here???
 
Thanks!
- Doug
__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to