Hi All,

  I am finding it hard to Map java.util.HashMap to an ActionScript
Object using Blaze DS.

  In the Adobe documentation it is given that Maps will be mapped to 
Associative array...

  How ever when i try to type cast the Object it is becoming null!!

Here my Server side Object

[CODE]
package com.myapp.valueObject.CollectionBrowserNode;

public class CollectionBrowserNode extends Node{
        
        private String dateCreated;
        
        private String description;
        
        private HashMap<String,String> propertyHolderMap;
    
        // Setter and Getters for the above follows.
}

[/CODE]

And my correpsponding Action Script Class is

[CODE]
  [Bindable]
[RemoteClass(alias="com.myapp.valueObject.CollectionBrowserNode")]
        public class CollectionBrowserNode extends Node
        {
                public function CollectionBrowserNode()
                {
                        super();
                }
                
                public var  dateCreated:String;
                public var  description:String;
                public var  propertyHolderMap:Array;
                
        }
[/CODE]

  I tried converting the Datatype to Object in the ActionScript Class
and it gets the Data but i am unable to read any thing form it..

  When i declared the type as Object and try to use the describeType
it returns the following..

[OUTPUT]
Object Type [XML String]=<type name="Object" isDynamic="true"
isFinal="false" isStatic="false">
  <method name="hasOwnProperty" declaredBy="Object"
returnType="Boolean" uri="http://adobe.com/AS3/2006/builtin";>
    <parameter index="1" type="*" optional="true"/>
  </method>
  <method name="isPrototypeOf" declaredBy="Object"
returnType="Boolean" uri="http://adobe.com/AS3/2006/builtin";>
    <parameter index="1" type="*" optional="true"/>
  </method>
  <method name="propertyIsEnumerable" declaredBy="Object"
returnType="Boolean" uri="http://adobe.com/AS3/2006/builtin";>
    <parameter index="1" type="*" optional="true"/>
  </method>
</type>
[/OUTPUT]

 And when try to type cast using 

var testArray:Array = obj as Array;
trace("testArray ="+testArray);

It prints the testArray as null !!!!

Not sure what's going wrong. Pls let me know ..

Thanks
Mars..

Reply via email to