Thank you Dimitrios, thank you so much!
-----Mensagem original-----
De: Dimitrios Gianninas [mailto:[EMAIL PROTECTED]
Enviada em: sexta-feira, 11 de março de 2005 11:06
Para: flexcoders@yahoogroups.com
Assunto: RE: [flexcoders] Doubts with remote objects

Hi,
 
You problem lies with the fact that the function you use to execute the remote call is the same onethat handles the result. You should have one function make the call and another one to handle it. Changes in red below.
 
<mx:RemoteObject id="temposCFC"
endpoint="
http://qualidade/flashservices/gateway"
source="weiler.intranet.components.controleTempos" showBusyCursor="true">
      <mx:method name="getDesenho" result="handleResult(event.result)"
fault="handleError(event.fault)" />
</mx:RemoteObject>
 
<!--ControleTemposAS.as-->
function gDesenho(){
      temposCFC.getDesenho.send();
}
 
function handleResult( event ) {
    // do something
}
 
function handleError( event) {
    // do something
}

 
Jimmy Gianninas
Software Developer - Optimal Payments Inc.
 


From: Kleber Voigt - Gmail [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 9:00 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Doubts with remote objects

Hello again,

I make an app that populate an datagrid with data from a remote object, the
data is loaded perfectly, but the function enter in a infinite loop. Looking
in the debbuger, I see the RPC are call and  work, and work, and work,
forever and ever :(

I'd try use a webservice to this, but the performance is very slow.

Where is my error? Anyone can explain how to use remote objects in flex with
examples?

Thanks,

Kleber Voigt

<!--ControleTempos.mxml-->
<mx:Script source="../com/ControleTemposAS.as" />
<mx:RemoteObject id="temposCFC"
endpoint="http://qualidade/flashservices/gateway"
source="weiler.intranet.components.controleTempos" showBusyCursor="true">
      <mx:method name="getDesenho" result="gDesenho(event.result)"
fault="gDesenho(event.fault)" />
</mx:RemoteObject>

<mx:DataGrid id="dg_desenhos" width="100%" height="100%"
dataProvider="{temposCFC.getDesenho.result}" load="gDesenho()" >
      <mx:columns>
            <mx:Array>
                  <mx:DataGridColumn columnName="DESENHO" headerText="Desenho"/>
                  <mx:DataGridColumn columnName="DESCRICAO" headerText="Descrição"/>
                  <mx:DataGridColumn width="70" columnName="USINAGEM"
headerText="Usinagem"/>
                  <mx:DataGridColumn width="70" columnName="MONTAGEM"
headerText="Montagem"/>
                  <mx:DataGridColumn width="70" columnName="TOTAL" headerText="Total"/>
            </mx:Array>
      </mx:columns>
</mx:DataGrid>

<!--ControleTemposAS.as-->
function gDesenho(){
      temposCFC.getDesenho.send();
}





AVIS IMPORTANT WARNING

Les informations contenues dans le present document et ses pieces jointes sont strictement confidentielles et reservees a l'usage de la (des) personne(s) a qui il est adresse. Si vous n'etes pas le destinataire, soyez avise que toute divulgation, distribution, copie, ou autre utilisation de ces informations est strictement prohibee. Si vous avez recu ce document par erreur, veuillez s'il vous plait communiquer immediatement avec l'expediteur et detruire ce document sans en faire de copie sous quelque forme.

The information contained in this document and attachments is confidential and intended only for the person(s) named above. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution, or any other use of the information is strictly prohibited. If you have received this document by mistake, please notify the sender immediately and destroy this document and attachments without making any copy of any kind.



Reply via email to