--- In [email protected], "loveewind" <[EMAIL PROTECTED]> wrote:
> 
I fail to store the Array in actionscript object to  the HashMap in 
Java object UserVO
and can be success to store the other data in the same actionscript 
object to store in Java object UserVO


the actionscript code below:

import com.zdus.crm.user.UserVO;

var accessMap:Array;

var user:UserVO;

function addUser(){
                        accessMap = new Array();
                        user = new UserVO();
                        user.firstName = firstName.text;
                        user.lastName = lastName.text;
                        user.networkId = networkId.text;
                        accessMap['farnet'] = farnet.data;
                        accessMap['crm'] = crm.data;
                        accessMap['onyx'] = onyx.data;
                        accessMap['cdms'] = cdms.data;
                        accessMap['par'] =par.data;
                        accessMap['promo']=promo.data;
                        user.accessMap = accessMap;
                        ro.addUser(user);
                        
        
                        
                }

what is the problem? tks

> --- In [email protected], "Andrew Spaulding" <[EMAIL PROTECTED]> 
> wrote:
> 
> you are right!thank you,
> > 
> > The hashMap is just an indexed array. You can access it if you 
know
> > the key value, or by normal array methods.
> > 
> > i.e. 
> > 
> > myMap
> > ['user1']=22;
> > ['user2']=33;
> > 
> > if you want user2 as the output then just reference myMap
['user2'] 
> or
> > if you want to treat it like an array then you could try the 
> following:
> > 
> > for( var i in myMap )
> > {
> > mx.controls.Alert.show( i + " : " + myMap[i] );
> > }
> > 
> > the above will output "user1 : 22" and "user2 : 33" 
> > 
> > this is a quite sample but just treat the hashMap or map as an 
> indexed
> > array and you should be able to figure it out!
> > 
> > Andrew
> > 
> > --- In [email protected], "loveewind" <[EMAIL PROTECTED]> 
> wrote:
> > > 
> > > return a Java object from my back_end system
> > > 
> > > below:
> > > public class UserVO {
> > >         private HashMap accessMap = null;
> > >   private String active    = null;
> > >   ........
> > >         public HashMap getAccessMap() {
> > >   return accessMap;
> > > }
> > > /**
> > >  * @param map
> > >  */
> > > public void setAccessMap(HashMap map) {
> > >   accessMap = map;
> > > }
> > > .......
> > > }
> > > the accessMap stored string object key and Integer obejct value
> > > 
> > > and I want to display the data on flex page,
> > > 
> > > how to use the actionscript to get the value ?
> > > 
> > > thanks,waiting for your help





 
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