Hola David,
Could you send the content of commonService?

Hiedra.

-----Mensaje original-----
De: David Slotemaker de Bruine <[email protected]> 
Enviado el: lunes, 15 de marzo de 2021 16:21
Para: [email protected]
Asunto: Strange conversion to JS

Hi all,

I have two CRUX calls to a RemoteObject which are semantically the same
1) works correctly:

[EventHandler(event="CommonEvent.EVENT_CARGAR_CONFIGURACIONES" )]
                public function cargarConfiguraciones(): void
                {               
                    appModel.isCommunicating(true);
                    
serviceHelper.executeServiceCall(commonService.cargarConfiguraciones(), 
resultCargarConfiguraciones, handleFaultResult);    
                };

2) Fails:
[EventHandler( event="CommonEvent.EVENT_CARGAR_ANYO_ACTUAL")]
                public function cargarAnyoActual(): void
                {       
                   appModel.isCommunicating(true);
                    serviceHelper.executeServiceCall( 
commonService.cargarAnyoActual(), resultCargarAnyoActual, handleFaultResult );  
  
                };



The first converts to the following Javascript:
services.CommonService.prototype.cargarConfiguraciones = function() {
  return /* implicit cast */ 
org.apache.royale.utils.Language.as(this.remoteObject.callProperty('cargarConfiguraciones'),
 mx.rpc.AsyncToken, true); };

The second:
services.CommonService.prototype.cargarAnyoActual = function() {
  return /* implicit cast */ 
org.apache.royale.utils.Language.as(this.remoteObject.getProperty('commonService').callProperty('cargarAnyoActual'),
 mx.rpc.AsyncToken, true); };


Notice that the second uses:

this.remoteObject.getProperty('commonService').callProperty(...

where 1 uses:

this.remoteObject.callProperty(...

Why is this so? 

The error that is thrown is:

 Uncaught TypeError: this.remoteObject.getProperty(...).callProperty is not a 
function
    at services.CommonService.cargarAnyoActual (CommonService.js:58)



Reply via email to