Sure, aaaaaaannd now I see the error.... my bad! I have a call  to common
service after the remoteObject. The perils of reusing a codebase....

Sorry and thanks!

 public function cargarConfiguraciones():AsyncToken
{
   return remoteObject.cargarConfiguraciones();
}

public function cargarAnyoActual():AsyncToken
{
   return remoteObject.commonService.cargarAnyoActual();
}

On Tue, 16 Mar 2021 at 17:49, Maria Jose Esteve <[email protected]> wrote:

> 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)
>
>
>
>

-- 

*David Slotemaker de Bruïne*
*Head of Educational Robotics*



Av. Sarriá, 130 - 08017 Barcelona
<https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>


T. +34 932 523 729 ext. 135

[email protected]

Reply via email to