java.util.Map is supported in any version of Flex and the following should work in either version:
 
var stab:Object = event.result;
for (var key:String in stab)
{
    txt.text = "-->" + stab[key];
}
<advanced>
Are you using Flex 1.5 or Flex 2? The difference between Flex 1.5 and Flex 2 is that Map is returned as Object in Flex 2... where as in Flex 1.5 it was technically an Array with named keys, but behaved like an Object syntactically. There are round trip use cases where this causes issues so we moved back to Flex 1.0 rules for Map and thus they're returned as Object now. There is a property that can be on a channel-definition that allows the legacy rules for Map serialization to be restored.
</advanced>


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of dos dedos
Sent: Tuesday, March 21, 2006 1:34 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] java.util.Map

just guessing ... but maybe there is no support yet in AS for Java map type

lorejava <[EMAIL PROTECTED]> wrote:
Hello,
I have a reading problem when I use returned a java.utilMap from a
Java class.

Follow my code:

Java class
----------

    public Map getHashMap()
    {
      Map hm = new HashMap();
        hm.put("HashMap1", "valore1");
        hm.put("HashMap2", "valore2");
        hm.put("HashMap3", "valore3");
      return hm;
    }

Flex Monitor result when i call my java method:
-----------------------------------------------
[array] :

length[Number] : 0

In AS I call and read the method in this way:
--------------------------------------------
remoteDataService.getHashMap().send;
...
var stab:Object=event.result;
txt.text="-->" + stab[0].value;

What's wrong??? All?
Thanks for your next replies. Bye






Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.

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




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to