brianraymes commented on issue #845:
URL: https://github.com/apache/royale-asjs/issues/845#issuecomment-639187900


   I ran into a similar issue recently. The solution was to register the 
ActionScript class with the one used in Java using `registerClassAlias`.
   
   I register all class aliases through a static method upon App initialization.
   
   Is the path to dbzDPRremarksSetupVO the same in Java and your Flex project? 
If so, the following should work. If not, correct the example below to include 
your actual java path.
   
   ```
   package some.path
   {
       import com.dbz.VO.INV.dbzDPRremarksSetupVO;
   
       public class RemoteClassesManager
       {
           public function RemoteClassesManager()
           {
               throw new Error("You cannot instantiate RemoteClassManager, as 
it has only static methods.");
           }
   
           public static function registerAllClasses():void
           {
               registerClassAlias("flex.messaging.io.ArrayCollection", 
ArrayList);
   
               // Custom classes
               // registerClassAlias("full.java.path", AS_Class);
               registerClassAlias("com.dbz.VO.INV.dbzDPRremarksSetupVO", 
dbzDPRremarksSetupVO);
           }
       }
   }
   ```
   
   In your main Application:
   ```
   <?xml version="1.0" encoding="UTF-8"?>
   <j:Application
       xmlns:fx="http://ns.adobe.com/mxml/2009";
       xmlns:j="library://ns.apache.org/royale/jewel"
       xmlns:js="library://ns.apache.org/royale/basic"
       . . .
       initialize="onInitialize(event)"
   ```
   
   ```
   private function onInitialize(event:Event):void
   {
       RemoteClassesManager.registerAllClasses();
   }
   ```
   Hope this helps.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to