RemoteObject + AsyncToken

Seems that FlexUnit 4 is a method that is marked with [Test (async)], even if inside, there's a real call to a RemoteObject using AsyncToken. The code looks like this:

[Test (async)]

public function testCreateProject():void

{

var responder: IResponder = Async.asyncResponder ( this,

new TestResponder (verifyNewProjectResult, verifyNewProjectFault), 5000);

var token: AsyncToken = remoteObject.createProject ();

token.addResponder (answering machine);

}

On the FlexUnit4 test here case framework http://opensource.Adobe.com/svn/opensource/FlexUnit/branches/4.x/FlexUnit4Test/src/flexUni tTests/flexUnit4/suites/frameworkSuite/cases/TestAsynchronous.as

There is a method that used the AsyncToken and TestResponder 'testAyncResponderFaultWithTestResponder', but what happens there is actually not async as the result is sent directly to the scope of the method with the token.applyResult. In fact goes to the remote object will cause FlexUnit pass method as nothing was happening. Or am I missing something?

Thanks in advance,

Adrian.

Adrian,

I will confirm understand here before I jump into this. Here, the AsyncReponder acts as a bridge of sorts. It simply allows the test method continue to run via an asynchronous event. Intrinsically, it does nothing to determine the success or failure of a test.

If a test ends without making a statement which is false, then this is a success. And, in this case, it would be to make assertions (or even just fails) in the verifyProjectResult and the verifyNewProjectFault. You may want something to fail in a given case, and this failure is the correct result, so we cannot make the assumption that just because the error handler is called the test fails.

So, if you wanted this fails if the fault has been called, you must do something like assert.fail() in the verifyNewProjectFault.

If it is also your understanding, and you don't believe it works, then I fill out a bug report and ask someone to take a look.

Thank you

Mike

Tags: Adobe Open Source

Similar Questions

  • How can I listen to the AsyncToken var events outside the implementation class

    Hello

    I use this:

    public void doSomething (): void

    {

    var token:AsyncToken=myRemoteObject.getData();

    token.addResponder (new mx.rpc.Responder (resultHandler, faultHandler));

    }

    private void resultHandler(event:ResultEvent):void

    {

    dispatchEvent (event);

    }

    private void faultHandler(event:FaultEvent):void

    {

    dispatchEvent (event);

    }

    And listening for events on the instantiated var.

    Which is the right way to do it, or is there a better?

    Thank you.

    I often see classes of service built as follows:

    public interface IMyService
    {
              function loadData(id:int):AsyncToken;
              function publishData(data:Object):AsyncToken;
    }
    
    public class MyService implements IMyService
    {
              private var _remoteObject:RemoteObject;
    
              protected function get remoteObject():RemoteObject
              {
                        if(!_remoteObject)
                        {
                                  _remoteObject = new RemoteObject("MyDestination");
                                  _remoteObject.showBusyCursor = true;
                                  _remoteObject.source = "my_service";
                        }
    
                        return _remoteObject;
              }
    
              public function loadData(id:int):AsyncToken
              {
                        return this.remoteObject.loadData(id);
              }
    
              public function publishData(data:Onject):AsyncToken
              {
                        return this.remoteObject.publishData(data);
              }
    
    }
    
    public class MyController
    {
    
              public var service:IMyService = new MyService(); //or find a better way to inject
    
              public function doStuff(id:int):void
              {
                        var token:AsyncToken = this.service.loadData(id);
                        token.addResponder(new Responder(loadData_resultHandler, loadData_faultHandler));
              }
    
         ...
    }
    

    The actual implementation may vary, but the idea is to have a class with methods that reflects your methods of service class and then summarized this thanks to an interface to allow different service implementations (if you want of course). It is of class type is usually referred to as a proxy or delegate class.

    I think mostly it's a matter of personal preference, but I've seen it implemented in this way by a large number of executives main (the Flash Builder function generator is one of them).

    Fixed type in the code.

  • AIR of CFCS with RemoteObject

    I have problems of access to a CFC on my local server to ColdFusion from an AIR application.  I get an error that I can not connect to http://localhost:8501 / flex2gateway /

    I know that my CF8 server runs.  I've already activated Flash remoting in the administration console see

    Here's my MXML application file, located in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Test2\src:

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:mx mx:WindowedApplication ' http://www.Adobe.com/2006/MXML "layout ="absolute"creationComplete =" init () "> "
    < mx:Script >
    <! [CDATA]
    Import mx.rpc.events.FaultEvent;
    Import mx.rpc.AsyncToken;
    Import mx.controls.Alert;
    Import mx.rpc.events.ResultEvent;

    private function init (): void
    {
    var token: AsyncToken = service.getdata ();
    token.addResponder (new mx.rpc.Responder (resultHandler, faultHandler));
    }

    private void resultHandler(result:ResultEvent):void
    {
    Alert.Show (result. Result.ToString ());
    }

    private void faultHandler(fault:FaultEvent):void
    {
    Alert.Show (Fault.Fault.ToString ());
    }
    []] >
    < / mx:Script >

    < mx:RemoteObject id = 'service '.
    " endpoint =" http://localhost:8501 / flex2gateway / "
    destination = "ColdFusion".
    source = "test1.messageService" / >

    < / mx:WindowedApplication >

    Here's my CFC which is C:\ColdFusion8\wwwroot\Test1\messageService.cfc

    < cfproperty >
    < name cffunction = "getdata" access = "remote" returntype = "string" >
    < cfreturn "it's the return message" >
    < / cffunction >
    < / cfproperty >

    "' Delete the last / endPoint ="http://localhost:8501 / flex2gateway"

  • Create remoteObject with ActionScript, no MXML

    I want to use remoteObject with ActionScript only, no MXML:

    private function initializeRemoteObject (): void {}
    _distante = new RemoteObject;
    _remote.source = "AMFProxyObject";
    _remote.endpoint = " " http://localhost/linktoMyAMFServer ";
    _remote.destination = 'zend ';
    _remote.showBusyCursor = true;
    }

    public function getIAllData (): void {}
    initializeRemoteObject();
    var token: AsyncToken = _remote.getAllDataFromStoryTable ();
    Token.Result = getDataHandler;

    I'm stuck here because I don't know the proper syntax to handle the result
    }

    private void getDataHandler () empty

    {

    ;//

    }

    I want to just convert the MXML below in ActionScript code.

    < mx:RemoteObject id = "zendRemoteObject" destination = "zend" source = "AMFProxyObject".
    " endpoint =" http://localhost/linktoMyAMFServer "         
    result = "resultHandler (Event)" >

    < name mx:method = "getAllDataFromStoryTable" result = "getDataHandler (event)" / >
    < / mx:RemoteObject >

    Thank you very much. It's driving me crazy, as I couldn't find any help online by Google.

    Try to use an answering machine, specifically an AsyncResponder.

       var token:AsyncToken = _remote.getAllDataFromStoryTable();
    
       var responder:AsyncResponder = new AsyncResponder( resultHandler, faultHandler );   token.addResponder( responder );
    
       public function resultHandler( event:ResultEvent, token:Object=null ):void   {      Alert.show( "RESULT: "+ event.result as String );   }
    
       public function faultHandler( event:FaultEvent, token:Object=null ):void   {      Alert.show( "FAULT: " + event.fault.message );   }
    

    The following documents may be useful:

    http://www.flexafterdark.com/docs/ActionScript-responder

    I hope this helps...

    Ben Edwards

  • [AsyncToken object] Message

    Hello
    I try to bind an operation on a value of function and receive a message [AsyncToken object] when I try to output the result. I tested the service in ColdFusion and returns the result correctly, so I have to do something incorrect on the Flex site. I included the code below and any help would be greatly appreachiated. Thank you.

    < mx:TextInput text = "{svc.translateFundingSource (codeList_grd.selectedItem.FUNDING_SOURCE)}" id = "test_ti" / > "

    Yes, the key here is all THE DATA SERVICE CALLS ARE ASYNCHRONOUS.

    The method 'send()' HTTPService and WebService and RemoteObject is an AsyncToken, NOT the result. You try to assing an AsyncToken to the text property and sure tht will not work.

    Asynchronous data calls are an obstacle for many new flex developers. In addition to the example above, here are som more snippets of code showing how to use HTTPService. It also shows the use of the AsyncToken, you can ignore until you need it. Note in particular the resultFormat = "e4x". Use this always, you'll be much happier.

    Tracy

    Code example using HTTPService, e4x, handler function to fill a list item.
    Also shows the use of AsyncToken.

    The tag of the DataGrid control:

    The HTTPService tag:
    Script block declaration:
    import mx.rpc.Events.ResultEvent;
    [Bindable]private var _xlcMyListData:XMLListCollection;

    Invoke send:
    var oRequest:Object = new Object();
    oRequest.Arg1 = ">
    var callToken:AsyncToken = service.send (oRequest);
    token.callId = "marequete1";

    Result handler function:
    private void onResult(oEvent:ResultEvent):void {}
    var xmlResult:XML = XML (event.result); Converts the result object in XML format. can also use 'under' operator
    var xlMyListData:XMLList = xmlResult.myListData; depends on the xml format, is data line
    _xlcMyListData = new XMLListCollection (xlMyListData); Wrap the XMLList in a collection
    trace (_xlcMyListData.ToXmlString ()); so you can see exactly how to specify the data area or establish labelFunction
    var callToken:AsyncToken = oEvent.token;
    var sCallId = callToken.callId; 'Marequete1 '.
    Switch (sCallId) {//Process the result under condition
    case 'marequete1 ':
    doQuery2(); No matter what
    break;
    ...
    }
    } //onResult

  • Max nested levels reached on item with RemoteObject

    Hello:

    We have an application that uses RemoteObject (with AMFPHP) connections to send a custom PHP class object. This object has several levels deep, with objects nested inside the main one. We have noticed that, after having reached a certain level, the RemoteObject accidents serialization throw this error:

    TypeError: Error #1034: Type coercion failed: cannot convert Object@7e30f89 to mx.messaging.messages.IMessage.

    We tried to send a lighter object, without property, just nested levels. The same thing happens. In the example:

    var params:Object = {};
    params['test'] = {0:{1:{2:{3:{4:{5:{6:{7:{8:{9:{10:{11:{12:{13:{14:{15:{16:{17:{18:{19:{20:{21:{22:{}}}}}}}}}}}}}}}}}}}}}}}};
    remoteObject.runService(params);
    

    If the object has fewer levels, it works:

    params['test'] = {0:{1:{2:{3:{4:{5:{6:{7:{8:{9:{10:{11:{12:{13:{14:{15:{16:{17:{18:{19:{20:{21:{}}}}}}}}}}}}}}}}}}}}}}};
    

    So, it seems that the RemoteObject has a maximum depth of 24 levels? Maybe 23, I m do not know. Sending in JSON is not an option, because I lost all the typed classes and objects inside the main object.

    Can anyone provide a good approach to deal with this problem?

    Thanks in advance!

    Solved: http://stackoverflow.com/questions/22936444/max-nested-levels-reached-on-object-sent-with-remoteobject

  • Problems with sandbox RemoteObject errors and security

    I have problems with an AS3 AMF RemoteObject application that is hosted on Google App Engine. I have a crossdomain.xml in the root of the domain file and also a remote endpoint.

    Here is the content of the root crossdomain.xml:

    <? XML version = "1.0"? >

    < cross-domain-policy >

    < site permitted-cross-domain-policies of control = 'all' / >

    < allow-access-from domain="*.appspot.com"/ >

    "< allow-access-from domain =" *. {appid}.appspot.com"/ >}

    "< allow-access-from domain =" *. {appid} .com "/ >"

    "< allow-access-from domain =" *. .org {appid} "/ >"

    < / cross-domain-policy >

    I replaced my request with {appid} ID. In the endpoint crossdomain.xml, he said exactly the same thing, but it omits the tag < site-control >.

    Loading the swf file and test it on my machine works fine... I think that may have something to do with me having the debugging version of Flash Player. When I push it up to App Engine to make it public, other clients access and get an error error #2048 Client.Error.MessageSend Channel.Security.Error url: http://05-alpha.latest. {AppID}.appspot.com/_rpc/Data}.

    I use Flex 4 beta and the duration of the App Engine Python. I tried many character generic in the crossdomain and even access to the endpoint of a relative URL data to avoid this error.

    Someone please help! Thanks in advance.

    Read this:

    http://tcoztechwire.blogspot.com/2010/02/Flash-Builder-bug-services-failing-

    SWF.html

  • A question about RemoteObject vs HttpService

    Hello

    I am newbie to Flex, please excuse if this is a stupid question.

    Please let me know when we should use HttpService and RemoteObject?

    Thanks in advance.

    RemoteObject:

    Binary transfer - moves more quickly through networks and deserialized by the Flash Player runtime quickly

    AMF gateway manages communication between your client and server objects to save you time coding your own service gateway. You can call your methods directly.

    HTTPService:

    Transfer of text - moves more slowly than the binary on networks. deserialization is slower, such that not natively conceived the Flash Player run-time.

    Service interface must be written to accept applications, call objects you scripted and then put in shape the answer.

    If your application consumes a lot of data, and you are responsible for the definition of the architecture of the server and the user interface, you may be better to opt for remote access.

    Claude Bur.

  • Fill ComboBox data RemoteObject

    Hi all

    I try to use RemoteObject to populate a combobox. Here is my purpose and value mxml code...

    // Value Object Class: dataVO.as
    package com.mycomp
    {
         [RemoteClass(alias="datavO")]
         [Bindable]
         public class dataVO {
              public var data_id:int;
              public var data_name:String;
              public var data_type:String;
         }
    }
    
    // ActionScript code
    private
    function getAuthors(event:Event):void
    {
         // setup the remoteobject here

         serviceRO.getData.addEventListener(ResultEvent.RESULT, resultListener);
    }
    private function resultListener(event:Event):void
    {
         dgrid1.dataProvider = event.result as Array; // works perfectly
         combo1.dataProvider = event.result.data_name as Array; // displays empty combobox
    }

    <!-- MXML Code -->
    <mx:ComboBox id="combo1" /> <!-- I want to populate names here -->
    <mx:DataGrid id="dgrid1" />

    How should I do this?

    Thanks and greetings

    ShiVik

    Hello

    I faced this problem somewhere, all I remember is that the table of variables has been registered on the event.result [0].

    I don't really understand why, but it worked for me.

    Try event.result [0] .data_name

    Otherwise, you will need to run through the result manually and make your own table of data_name.

    Try to debug and see the structure of the result.

    Hope this helps,

    Salem

  • Cannot find the 'endpoint' with 'RemoteObject' property in Flex 3

    Hi all
    I am uttering the 'RemoteObject' class object inside the class action script. I'm here
    unabe to find ownership of "endpoint" with the remote object in Flex 3.0.I am currently using
    the SDK 3.2.Earlier I used this property earlier in Flex 2.0.Can whole body sugget me what
    is the replacement in flex 3 for this, or how to get this property.

    In Flex 2.0
    ===========
    var rm:RemoteObject = new RemoteObject;
    RM.source = "ServerSideClassName";
    RM.destination = 'amfphp ';
    RM. EndPoint =http://Ip or server PC/ProjectName/amfphp/gateway.php;
    In Flex 3 (sdk 3.2)
    ==================
    var rm:RemoteObject = new RemoteObject;
    RM.source = "ServerSideClassName";
    RM.destination = 'amfphp ';
    Cannot find rm.endpoint here.
    Thnx in advance
    Mayeul Singh Bartwal

    Hello Arnaud

    I m not sure but I think you used the remote object from the package of «mx.rpc.remoting.RemoteObject» class

    instead of "mx.rpc.remoting.mxml.RemoteObject. That's why is does not show property as the 'end point '.

    To verify remote call from the package «mx.rpc.remoting.mxml.RemoteObject» with the object

    May helps you

    Thank you

    Virat Patel

  • Manager result HTTPService fires twice when called using AsyncToken

    HTTPService is defined as:
    " < mx:HTTPService id ="recurrenceHttpService"url =" http://localhost:8080/project/recurrence.AJAX "" "
    method = "GET" resultFormat = "xml" useProxy = "false" showBusyCursor = "true" / >

    When I call a service using http:
    service.addEventListener (ResultEvent.RESULT, responder.result);
    service.addEventListener (FaultEvent.FAULT, responder.fault);
    service. Send (params);

    (answering machine is an IResponer, params is an object with parameters)

    The result is correct a call to the result handler.

    but when I call using an AsyncToken:
    var token: AsyncToken = service.send (params);
    token.addResponder (responder);

    the result handler is called twice.

    It is the stack in two cases.
    first time:
    com.structures.Commands::GenerateDatesForRecurrenceCommand/result
    MX. RPC::AsyncToken / http://www.adobe.com/2006/Flex/MX/Internal:applyResult   
    MX. CPP. Events::ResultEvent / http://www.adobe.com/2006/Flex/MX/Internal:callTokenResponders   
    HTTPOperation / http://www.Adobe.com/2006/Flex/MX/internal:dispatchRpcEvent   
    MX. RPC::AbstractInvoker / http://www.adobe.com/2006/Flex/MX/Internal:resultHandler   
    MX. RPC::responder/result
    MX. RPC::AsyncRequest/acknowledge
    DirectHTTPMessageResponder/completeHandler
    Flash. Events::EventDispatcher / dispatchEventFunction [source]
    Flash. Events::EventDispatcher / dispatchEvent [source]
    Flash. net::URLLoader / OnComplete [source]
    Second time:
    com.structures.Commands::GenerateDatesForRecurrenceCommand/result
    MX. RPC::AsyncToken / http://www.adobe.com/2006/Flex/MX/Internal:applyResult   
    MX. CPP. Events::ResultEvent / http://www.adobe.com/2006/Flex/MX/Internal:callTokenResponders   
    MX. RPC.http.MXML::HTTPService/ http://www.adobe.com/2006/Flex/MX/Internal:dispatchRpcEvent   
    HTTPOperation / http://www.Adobe.com/2006/Flex/MX/internal:dispatchRpcEvent   
    MX. RPC::AbstractInvoker / http://www.adobe.com/2006/Flex/MX/Internal:resultHandler   
    MX. RPC::responder/result
    MX. RPC::AsyncRequest/acknowledge
    DirectHTTPMessageResponder/completeHandler
    Flash. Events::EventDispatcher / dispatchEventFunction [source]
    Flash. Events::EventDispatcher / dispatchEvent [source]

    ideas?

    Yes, looks like it was fixed at 3.5

    http://bugs.Adobe.com/jira/browse/SDK-22883

  • RemoteObject Flex-&gt; Java

    Hi, I use Flex + Java in my application and I had some problems to use RemoteObject between Java and Flex, but I solucinated this problem. Now, I want to change thinking in Java when I think in Flex. I have a tree and I delete, rename, add folders in Flex, but I must say in Java, I delete this folder. But I don't know how I can do this comunnication. Is the same Java-Flex or Flex-Java.

    For example, I have this function:

    private void deleteFolder (): void {}
    var node: XML = XML (newTree.selectedItem);
    If (node == null) return;
    var children: XMLList = XMLList (node.parent () .children ();
    for (var i: Number = 0; i < children.length (); i ++) {}
    If (children[i].@label == node.@label) {}
    delete children [i];
    }
    }
    }

    And I would like to call to my Java method to say, we must delete this folder, you also delete.

    Mid Java method here. I get what file I want to delete, but I don't now how to use the RemoteObject to do.

    public static eliminarCarpeta (String foldername) Sub throws MessagingException
    {
    Folder delfolder = store.getFolder (foldername);
    delfolder. Delete (false);
    }

    The Java-Flex, I've got this remote object

    < mx:RemoteObject id = "srv" = "conex" fault destination = "Alert.show (event.fault.faultString), 'Error'" >
    < name mx:method = 'getFolder"result ="treeLoadedResult (event)"/ >

    But I don't know how is comunication Flex-Java.

    Thank you!

    No worries.  I hope that this code gives you a better understanding.  I added a few comments to help you see my understanding of your problem.  Hope, it helps to / is correct for your needs!

    Name of the function: deleteFolder

    Objective function: remove a file from the file system

    The function parameters: public - the path to the file that needs to be deleted

    private void deleteFolder(filePath:String):void {}
    var node: XML = XML (newTree.selectedItem);
    If (node == null) return;
    var children: XMLList = XMLList (node.parent () .children ();
    for (var i: Number = 0; i< children.length();="" i++)="">
    If (children[i].@label == node.@label) {}
    delete children [i];
    srv.deleteFolder (filePath); the folder I want to deleted
    }
    }
    }

    Function name: getRuta

    Objective function: return the path of the currently selected item in the tree of event.currentTarget

    private function getRuta (): String {}

    var point: Object = newTree.selectedItem; newTree-jumps is everything the user needs to click on before clicking on the button

    var ruta:String = item.@label;

    While (true) {}

    If (newTree.getParentItem (item)! = null) {}
    Item = newTree.getParentItem (Item)
    Ruta = item.@label + "." + ruta;
    } else {break ;}

    }

    trace ("Ruta" + ruta);

    deleteFolder (ruta);

    return the ruta;

    }

    private function getAndDeleteFolder (): void {}

    var path: String = getRuta();

    deleteFolder (path);

    }

  • Results of RemoteObject

    Don't know what got into me today... feel like I'm it lose.

    I make a list of users return a RemoteObject method call. I can't remember how to parse out them. This is the appropriate method?

    private function loadUsersByGroupHandler(event:ResultEvent):void
    {
         try
         {
              this._assignedUsers = event.result as ArrayCollection;
         }
         catch (error:FaultEvent)
         {
              this.parentDocument.faultHandle(event);
         }
    }
    

    The problem here is that when I do that, I am unable to inspect the resulting collection ArrayCollection for length or anything else, as the following fails (no error is thrown, but also no alert is displayed):

    private function loadUsersByGroupHandler(event:ResultEvent):void
    {
         try
         {
                   Alert.show(ArrayCollection(event.result).length.toString());
              this._assignedUsers = event.result as ArrayCollection;
         }
         catch (error:FaultEvent)
         {
              this.parentDocument.faultHandle(event);
         }
    }

    Try this ._myAC = new collection ArrayCollection (event.result as Array)

    Sincerely,

    Michael

    22/04/2009, a las 14:22, Miggl [email protected]> escribio:

    >

    Don't know what got into me today... feel like I'm it lose.

    >

    I make a list of users return a RemoteObject method call. I have

    can't remember how to parse out them. Is it the

    appropriate method?

    private void loadUsersByGroupHandler(event:ResultEvent):void

    {

    Try

    {

    This ._assignedUsers = event.result as ArrayCollection collection;

    }

    catch (error: ResultEvent)

    {

    this.parentDocument .faultHandle (event);

    }

    }

    >

    >

    The problem here is that when I do that, I am unable to inspect the

    resulting collection ArrayCollection for length or anything else, as the

    following fails (no error is thrown, but also no alert is displayed):

    private void loadUsersByGroupHandler(event:ResultEvent):void

    {

    Try

    {

    Alert.Show (ArrayCollection (Event.Result) .length. ToString());

    This ._assignedUsers = event.result as ArrayCollection collection;

    }

    catch (error: ResultEvent)

    {

    this.parentDocument .faultHandle (event);

    }

    }

    >

  • How to catch commissariats of remoteObject?

    Hello
    I invoke a remoteObject, the remoteObjects method is a java object that might throw an exception. How can I catch the exception in flex?
    Thank you.

    You create a handler for the event of fault of the remoteObject - for example:

    var remoteObject:RemoteObject
    ...
    remoteObject.someMethod.addEventListener ("fault", serverFault)

    See you soon,.

    Simon

  • Using a DataGrid control to get a RemoteObject

    What I have is a compound of two components. A component is a datagrid control that contains a list of users in it. The other component is just a group of checkboxes.

    Do I have to be able to do is select a user in the DataGrid and the second part, do trigger a RemoteObject call and returns the data about the person I selected in the datagrid control. What I need to know, is how to move selected users ID value to the RemoteObject call? The ID of the selected user is contained in an object called SelUserInfo.UserCnt. This object is sent to the second component when something is selected in the data grid. So far, that's what I have my code...

    My RemoteObject call:
    < mx:RemoteObject id = "getUserSec" destination = "ColdFusion" source = "ISIF. WebServices.Flex.UserData"ShowBusyCursor ="true">
    < mx:method name = "getUserSecRoles" result = "getRolesHandler (event)" >
    < mx:arguments >
    {SelUserInfo.UserCnt} < UserCnt > < / UserCnt >
    < / mx:arguments >
    < / mx:method >
    < / mx:RemoteObject >

    My Manager for the RemoteObject call:
    [Bindable]
    private var userSecRoles:ArrayCollection;

    private void getRolesHandler(event:ResultEvent):void
    {
    userSecRoles = new collection ArrayCollection (event.result as Array);
    }


    My function which is called when a user is selected in the datagrid control:
    public void getUserRoles(): Sub
    {
    getUserSec.getUserSecRoles.send ();
    }

    The problem is that the userSecRoles is always null. Does anyone know if I call the Number correctly?

    Have an ordinary day...
    KomputerMan ~ |  :-)

    Problem was found to be in the order that things were called. I would call the datagrid listener when a user has been selected by using this code:

    [Bindable]
    private var selectedUser2:Object;

    private void userSelHandler2(event:KDL_SelEvent):void
    {
    selectedUser2 = event. KDL_SelObject;
    getUserSec.getUserSecRoles (selectedUser2.UserCnt);
    Roles2TempID.getUserRoles (); initialize checkboxes
    }

    GetUserSec.getUserSecRoles (selectedUser2.UserCnt); line call my RemoteObject that calls the following event handler, to the Office of receiver data in a table.

    [Bindable]
    private var myUserSecRoles:ArrayCollection;

    private void getRolesHandler(event:ResultEvent):void
    {
    myUserSecRoles = new collection ArrayCollection (event.result as Array);
    }

    Problem is that the Roles2TempID.getUserRoles (); line of my datagrid selected event would trigger before the RO call was finished. In this way, I had all the data when the model is being developed. To resolve this problem, I call the code to initialize my model after that my manager RO be finished like this:

    [Bindable]
    private var myUserSecRoles:ArrayCollection;

    private void getRolesHandler(event:ResultEvent):void
    {
    myUserSecRoles = new collection ArrayCollection (event.result as Array);
    Roles2TempID.getUserRoles (); initialize checkboxes
    }

    Now the data is passed to the template until the model itself is initialized. My guess is that I have to do it this way because of Flex how threads. You mind just a guess. But it works now!

    Have an ordinary day...
    KomputerMan ~ |  :-)

Maybe you are looking for