The register class alias below needs to be modified to the following. This will 
treat ArrayCollections as ArrayLists from BlazeDS.

// Treat ArrayCollection locally as Royale ArrayList
registerClassAlias("flex.messaging.io.ArrayCollection", ArrayList);


Brian


From: [email protected] <[email protected]>
Sent: Thursday, June 24, 2021 10:48 AM
To: [email protected]
Subject: [EXTERNAL] Re: users Digest 23 Jun 2021 15:46:41 -0000 Issue 1724


Good Day,

Thanks for your response. I have resolved the issues I was having. I have been 
able to do test with mx royale remote object. I discovered that I had to use 
the maven compilation option "option-with-swf". Then added some more 
dependencies. I looked up the dependencies from the parent module in the Remote 
AMF example project.


I have noticed that blazeds returns an "mx.collections.ArrayCollection" object 
for arrayList of custom object or arrayList of String or arrayList of Short 
server side (java).


As a result, adding the below code


  registerClassAlias("flex.messaging.io.ArrayList", ArrayList);  //


to give me
org.apache.royale.collections.ArrayList

Does not work. As a result, I have to convert to convert from  
"mx.collections.ArrayCollection" to "org.apache.royale.collections.ArrayList" 
to use my records in jewel datagrid.


I don't mind doing the conversion but I am wondering if this is an abnormal 
situation. Any ideas ?



Also please what is the maven dependency for
import org.apache.royale.net.remoting.amf.AMFBinaryData

AMFBinaryData.DEBUG = true;

The above code does not compile. I had to comment it out.


Regards,

On Thursday, June 24, 2021, 06:45:59 PM GMT+1, 
[email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>> wrote:


Good Day,

Thanks for your response. I have resolved the issues I was having. I have been 
able to do test with mx royale remote object. I discovered that I had to use 
the maven compilation option "option-with-swf". Then added some more 
dependencies. I looked up the dependencies from the parent module in the Remote 
AMF example project.


I have noticed that blazeds returns an "mx.collections.ArrayCollection" object 
for arrayList of custom object or arrayList of String or arrayList of Short 
server side (java).


As a result, adding the below code


  registerClassAlias("flex.messaging.io.ArrayList", ArrayList);  //


to give me
org.apache.royale.collections.ArrayList

Does not work. As a result, I have to convert to convert from  
"mx.collections.ArrayCollection" to "org.apache.royale.collections.ArrayList" 
to use my records in jewel datagrid.


I don't mind doing the conversion but I am wondering if this is an abnormal 
situation. Any ideas ?



Also please what is the maven dependency for
import org.apache.royale.net.remoting.amf.AMFBinaryData

AMFBinaryData.DEBUG = true;

The above code does not compile. I had to comment it out.


Regards,
On Wednesday, June 23, 2021, 04:46:44 PM GMT+1, 
<[email protected]<mailto:[email protected]>>
 wrote:



users Digest 23 Jun 2021 15:46:41 -0000 Issue 1724

Topics (messages 4767 through 4769)

Switching from js remoteObject to mx remoteObject
    4767 by: romanisitua.yahoo.com

Blaze ds does not serialize typed java arrayList to as3 arrayList correctly
    4768 by: romanisitua.yahoo.com
    4769 by: Maria Jose Esteve

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: 
[email protected]<mailto:[email protected]>
To unsubscribe, e-mail: 
[email protected]<mailto:[email protected]>
For additional commands, e-mail: 
[email protected]<mailto:[email protected]>

----------------------------------------------------------------------


Hi everyone,

I am trying to switch from using js:RemoteObject to mx:RemoteObject.
I have studied the code in the "remote object amf test" project.

I am using jewel for the application. After registering the mx namespace
in the relevant places

xmlns:mx="library://ns.apache.org/royale/mx"

During compilation I get the following error

Content2.mxml(85): col: 11 Error: This tag is unexpected. It will be ignored.

          <mx:RemoteObject id="service" result="onResult(event)" 
fault="onFault(event)"


It appears the compiler does not recognise the mx:RemoteObject class.
In other words the mx library is not loaded. I have checked my pom.xml to 
ensure that
the required royale dependencies is loaded.

Any ideas ?


Regards,




Hi everyone,

I have the following classes server side

 public class ShortType
 {
   private List<Short> values;

   // values has getter and setter
 }


 public class StringType
 {
   private List<String> values;

   // values has getter and setter
 }


 With their corresponding as3 classes

  import org.apache.royale.collections.ArrayList;

     [RemoteClass(alias="com.test.generic.dto.types.ShortType")]
     [Bindable]
     public class ShortType
    {


       private var _values:ArrayList;





  public function set values(values:ArrayList) : void
       {
              trace(" --- short values list set --- ");

           this._values = values;
       }

       public function get values():ArrayList
       {
           return this._values;
       }

   }


   import org.apache.royale.collections.ArrayList;

     [RemoteClass(alias="com.test.generic.dto.types.StringType")]
     [Bindable]
     public class StringType
    {


       private var _values:ArrayList;





  public function set values(values:ArrayList) : void
       {
              trace(" --- short values list set --- ");

           this._values = values;
       }

       public function get values():ArrayList
       {
           return this._values;
       }

   }


   When trying to access the values arrayList in royale the content of the 
array list is incorrect

   for example if a put short values 14, 100 in the arrayList server side, I 
will get an array list with values (0, 1)

   The samething if I put String vales "Mr", "Mrs" in the arrayList server 
side, I will get an array list with values (0,1)


   Clearly blazeds is not serializing the List<String> and List<Short>.

   Any ideas ? I am using js:RemoteObject to perform the call.

   I tried switching to mx royale but I keep getting compiler errors whenever I 
reference mx royale classes. I tried to follow the example where mx royale 
remote object was used in a jewel app but compiler errors keep coming up.



   Would appreciate help on this. I am pretty stuck at the moment.


Regards,





Hi romanisitua,



I have not worked with Blazeds, I have always used FluorineFx with vb.net so I 
do not know if what I am going to tell you will be useful to you...

- Make sure that event.result returns the ShortType.vlues and StringType.values 
object, which "I understand you do get them right".

- Check that the type class of each of the rows of "values" is recognized and 
mapped (If you launch debug, you can set a breakpoint and expand event.result).

- If it has not recognized and mapped the classes.... Verify that they are 
defined in "com.test.generic.dto.types.*".

- Verify that in App.mxml you have indicated : 
registerClassAlias("flex.messaging.io.ArrayCollection", ArrayList);

- Could you send me the code of the callback function?



Verify me these points and we continue with the debugging.



Hiedra.



De: [email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>
Enviado el: martes, 22 de junio de 2021 22:50
Para: [email protected]<mailto:[email protected]>
Asunto: Blaze ds does not serialize typed java arrayList to as3 arrayList 
correctly





Hi everyone,



I have the following classes server side



 public class ShortType

 {

   private List<Short> values;



   // values has getter and setter

 }





 public class StringType

 {

   private List<String> values;



   // values has getter and setter

 }





 With their corresponding as3 classes



  import org.apache.royale.collections.ArrayList;



     [RemoteClass(alias="com.test.generic.dto.types.ShortType")]

     [Bindable]

     public class ShortType

    {





       private var _values:ArrayList;











  public function set values(values:ArrayList) : void

       {

              trace(" --- short values list set --- ");



           this._values = values;

       }



       public function get values():ArrayList

       {

           return this._values;

       }



   }





   import org.apache.royale.collections.ArrayList;



     [RemoteClass(alias="com.test.generic.dto.types.StringType")]

     [Bindable]

     public class StringType

    {





       private var _values:ArrayList;











  public function set values(values:ArrayList) : void

       {

              trace(" --- short values list set --- ");



           this._values = values;

       }



       public function get values():ArrayList

       {

           return this._values;

       }



   }





   When trying to access the values arrayList in royale the content of the 
array list is incorrect



   for example if a put short values 14, 100 in the arrayList server side, I 
will get an array list with values (0, 1)



   The samething if I put String vales "Mr", "Mrs" in the arrayList server 
side, I will get an array list with values (0,1)





   Clearly blazeds is not serializing the List<String> and List<Short>.



   Any ideas ? I am using js:RemoteObject to perform the call.



   I tried switching to mx royale but I keep getting compiler errors whenever I 
reference mx royale classes. I tried to follow the example where mx royale 
remote object was used in a jewel app but compiler errors keep coming up.







   Would appreciate help on this. I am pretty stuck at the moment.





Regards,








Reply via email to