Flex 1.5 does a pretty good job of automatically translating Java 
types to ActionScript, but only for members that are declared 
public, not private.  So, if you want to continue using your getter 
routines for private members in your existing classes, be prepared 
to make a lot of calls to your remote object.  You could also create 
a new "facade" Java class for mapping purposes, which would have 
public members for all the variables you want to expose to 
ActionScript, and have that class make all the calls to your 
existing class's getters to initialize those public members.  You 
can then refer to the variables by name (the same name as in the 
Java class) from within ActionScript.

Another thing to keep in mind is that datagrids expect to be passed 
arrays (actually, anything that implements the DataProvider 
interface) of objects, not a single object.  If your Java calls are 
returning a single object instead of a list of objects, use 
mx.utils.ArrayUtil.toArray() on the result to convert it to an array 
in ActionScript.

Doug


--- In [email protected], "sshriyan27" <[EMAIL PROTECTED]> 
wrote:
>
> I'm new to Flex we're trying evaluate in our company whether we 
> should use FLEX or not. Right we have Java, Struts based 
application.
> 
> I have a simple question, i have an Object and still strugling to 
> map that to an action script and datagrid.
> How do i display values of UserProfileForm in datagrid, like in 
> Struts i used to do  CloserResultsForm.userProfileForm.firstname
(); 
> Can some one explain this to me. 
> ** I can get the Single object to get displayed but not the 
> inhertited ones.
> 
> public class CloserResultsForm implements Serializable{
>       private UserProfileForm userProfileForm;
> }
> 
> public class UserProfileForm {
>       private String username=null;
>       private int userid;
>       private String password=null;
>       private String firstname=null;
>       private String lastname=null;
>       private String roleName=null;
>        
>     public UserProfileForm(){
>        
>     }
>  .... // then getters and setters for the above
> }
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to