Hey Madan,
Not sure if this will work for you or if this is what you're talking about.
I do have this class in Flex (this is a simple Bean)
package com.posadas.linc.entidades
{
import mx.collections.ArrayCollection;
[RemoteClass(alias="com.posadas.linc.comunes.AdminHotelPagina")]
[Bindable]
public class AdminHotelPagina {
public var numero: Number = 1;
[ArrayElementType("com.posadas.linc.entidades.AdminHotel")]
public var list: ArrayCollection = null;
}
}
_______________________________
And this is my Java side
package com.posadas.linc.comunes;
import java.util.List;
import com.posadas.linc.entidades.AdminHotel;
public class AdminHotelPagina {
private static final long serialVersionUID =
1L;
private int numero = 0;
private List<AdminHotel> list = null;
}
}
****************** This is the Class that I'm listing
************************
package com.posadas.linc.entidades;
import java.io.Serializable;
public class AdminHotel implements Serializable {
private static final long serialVersionUID =
1L;
private int id = 0;
private String nombre = null;
private String siglas = null;
private int idMarca = 0;
private String marca = null;
}
}
So I guess the main things will be this specification ->
[ArrayElementType("com.posadas.linc.entidades.AdminHotel")]
Anyway this is not all the code, hope this helps you!
If you still face more issues, do not hesitate, let us know how to help you!
Regards,
Mike
From: [email protected] [mailto:[email protected]] On
Behalf Of Madan Narra
Sent: Martes, 26 de Mayo de 2009 07:41 a.m.
To: [email protected]
Subject: [flex_india:22523] Java List to Flex ArrayCollection
Hi All,
Was having trouble getting Java List object to Flex ArrayCollection in this
program
A.java
package com.package;
public class A {
..................
}
B.java
package com.package;
public class B {
private String dummyField;
private List<A> listOfA;
// gettets and setters
}
Now at the flex side
A.as
package {
[RemoteClass(alias="com.package.A")]
public class A {
............
}
}
B.as
package {
[RemoteClass(alias="com.package.B")]
public class B {
public var dummyField:String;
public var listOfA:ArrayCollection;
}
}
As shown above, i defined the classes appropriately at flex side. The alias
provided for the flex actionscript class are the correct ones.
When i get the object of B from a remote object and call the listOfA
variable, its always returned as "null". But when i access the dummyField,
am able to get the value that is set into it.
If the return type of the remote service object is List<xxx>, than we get
the result as " event.result as ArrayCollection " - This way its working
perfectly.
But when receiving an Object, which has a List in that and when this is
being accessed its returned as null.
Anyone faced such kind of issue.
Let me know what changes i need to do.
Thanks in advance
--
Thanks,
Madan N
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---