troubleshooting Question

Mappling Java Objects to ActionScript Object with RemoteClass and BlazeDS

Avatar of meena_r
meena_r asked on
JavaJava EEApache Flex
36 Comments1 Solution4089 ViewsLast Modified:
Hello,
I want to pass a java object which has an arraylist, this arraylist has another object added into it, through RemoteObject and blazeDS I am stuck at one place though. My java class has one ArrayList of Objects (which is another java class) (sorry in advance for long post however I wanted to make it clear) for example
Java class:
public class UserAccountDTO{

Private String loginID;
Private String name;
private  ArrayList<AssignedFunctionDTO> assignedFunction;
&&&
&&..

//getter and setter method
//no args constructor
// constructor to set all these values from outside
Public UserAccountDTO(String loginID,String name, ArrayList assignedFunction){
            this.setLoginID(loginID);
            this.setName(name);
            this.setAssignedFunction(assignedFunction);
}
}

public class AssignedFunctionDTO(){
      private int function_id;
      private String function_name;
     
//getter and setter methods
//no args constructor
//constructor to set all these value from out side      
}

Then the method which Remote Object service calls
Public loginUtil(){

//fetches user records from database
//creates arraylist of AssignedFunctionDTO by
assignedFunction.add(new AssignedFunctionDTO(functioned,functionName);
//returns UserAccountDTO object by
      Return new UserAccountDTO(loginID,name,assignedFunciton);
}

I am using blazeds for remoting and cairngorm for structure and created two DTO classes in flex like this:
Package;
{
[RemoteClass(alias=myPackage.UserAccountDTO)]      
Public class UserAccountDTO{
      Public var loginID:String;
      Public var name:String;
Public var assignedFunctaion:Object //I tried using AssignedFunctionDTO/ArrayCollection too
}
}

Package;
{
[RemoteClass(alias=myPackage.AssignedFunctionDTO)]      
Public class AssignedFunctionDTO {
      Public var function_id:int;
      Public var function_name:String;
}
}

In my command class I am not getting value of AssignedFunctionDTO its null
I am doing : modelLocator.userAccountDTO = event.result;

This gives me everything other then AssignedFunctionDTO dont know why, if I pass a simple arraylist I get its value, however I do not get value of ArrayList which contains another object inside it&I think I am missing something here however I have no idea about it&please bare with me... please help
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 36 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 36 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros