0 Replies Latest reply on Jul 16, 2009 10:39 AM by CiD70

    remoteObject shared

    CiD70

      Hi..

       

      iam sorry about my weriten english..

      my problem is that i want to use in my flex applications a unique remoteObject that provides data to my forms from a mysql db trougth a webOrb and php class but  asincronics calls represents a problem  because i made a function handler that recibe as parameters a target object, a string with the name of the array that ´ll take a new data provider builted in the same function, this function is too the eventHandler for the remoteObject an this alows resolve a dataprovider for any object in my form...

       

      the problem begins when try to charge data for two or more object at the same time... for  examplea for tow combobox controls in a click event or crationComplete event because i made as folow..

       

      thsts my remoteObject definition...

      <mx:RemoteObject showBusyCursor="true"

      id="rOListaGrid"

              result="onResultService(event,oTarget,cDataProviderName)"

      destination="GenericDestination"

      source="queryssiodd">

       

      and my calls for the remoteObject are made as follow

      cDataProviderName='aryAreas';

      oTarget=area;

      rOListaGrid.consulta('select codigo,nombre from areas')

       

      // at this point call to get data to first comboBox

       

      cDataProviderName='aryNivelesAcceso';

      oTarget=nivel_acceso;

      rOListaGrid.consulta('select nivel,descripcion from perfiles_usuarios')

       

      // at this point call to get data to the second comboBox

       

      thats is my function           public function

      onResultService(event:ResultEvent,oTarget:Object,cNombreArray:String):void{

                   aryDataProviders[cNombreArray] = new ArrayCollection(event.result as Array);

                   oTarget.dataProvider=aryDataProviders[cNombreArray];               oTarget.status=1;

                 }

                                                                                                                                                                                                      i tryed making a functions looping  beween calls to give time to the calls to ends and return the data to the applications object but it did not work.

       

      thank you for your time..   atte: Hector

       

      pd: the files with the code are included in the attach section of this post

       

      tks again...