Hi everybody,
The debug log of BlazeDS shows that the java.util.HashMap get's
converted to an Object.
*** debug log ***
[BlazeDS]07/29/2008 [DEBUG] [Endpoint.AMF] Serializing AMF/HTTP response
Version: 3
(Message #0 targetURI=/2/onResult, responseURI=)
(Externalizable Object #0 'DSK')
(Typed Object #1 'test.MyValue')
s = "TEST"
params = (Object #2)
sys_attribute_n1 = 1.0
sys_object_tbl_obj_name = "Test Value"
*** debug log ***
So on the Flex side I can store this value only in attribute with type
Object.. is this correct?
If yes how can access the attributes of my object if they are dynamic
as hashmaps usually are?
o.sys_attribute_n1 //static access
I need somethin like this (dynamic access).
for each(String attribute in o.getAttributesOfObject()) {
trace(o[attribute]).
}
Does anybody know how to access dynamic attribute?
thanks a lot and regards
cyrill
--- In [email protected], "cyrill.zadra" <[EMAIL PROTECTED]>
wrote:
>
> Hi,
>
> Well I'm have some troubles using a HashMap on the server-side.
>
> I use a java remote custom object, which contains a hashmap as one of
> its attributes. The custom object should be converted to the
> ActionScript object MyValue when it's getting transfered to the client.
>
> But on the client-side I always geht a error.
>
> ***TypeError: Error #1034: Typumwandlung fehlgeschlagen:
> [EMAIL PROTECTED] kann nicht in Array umgewandelt werden.***
>
> Which is the correct ActionScript type for the HashMap?
>
> #### Java Class ####
> package test;
> import java.util.HashMap;
>
> public class MyValue {
> public String s;
> public HashMap<String,Object> params;
> }
> ####################
>
>
> #### ActionScript Class ####
> [RemoteClass(alias="test.MyValue")]
> public class MyValue
> {
> public function MyValue() { trace("MyValue Constructor"); }
>
> public var s : String;
> public var params : Array;
>
> public function toString() : String
> {
> return s + " - " + params;
> }
> }
> ############################
>
> thx & regards
>
> Cyrill
>