You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by mark goldin <ma...@gmail.com> on 2015/04/27 17:43:55 UTC

Cast results from server

I am getting data from a server as an ArrayCollection of a server class
objects.
How can I cast each element into a class that I am defining in ActionScript?

Thanks

Re: Cast results from server

Posted by mark goldin <ma...@gmail.com>.
The server returns a list of typed objects, but on UI side it's an
ArayCollection of objects. Not sure it's correct though ....

On Mon, Apr 27, 2015 at 12:08 PM, OmPrakash Muppirala <bi...@gmail.com>
wrote:

> Why is the casting not done on the server side?  If you can cast something
> into an ArrayCollection, you should be able to cast other objects too.
>
> Thanks,
> Om
> On Apr 27, 2015 8:44 AM, "mark goldin" <ma...@gmail.com> wrote:
>
> > I am getting data from a server as an ArrayCollection of a server class
> > objects.
> > How can I cast each element into a class that I am defining in
> > ActionScript?
> >
> > Thanks
> >
>

Re: Cast results from server

Posted by OmPrakash Muppirala <bi...@gmail.com>.
Why is the casting not done on the server side?  If you can cast something
into an ArrayCollection, you should be able to cast other objects too.

Thanks,
Om
On Apr 27, 2015 8:44 AM, "mark goldin" <ma...@gmail.com> wrote:

> I am getting data from a server as an ArrayCollection of a server class
> objects.
> How can I cast each element into a class that I am defining in
> ActionScript?
>
> Thanks
>

AW: Cast results from server

Posted by Christofer Dutz <ch...@c-ware.de>.
Actually (If you're talking about AMF communication using BlazeDS, Granite, Adobe LiveCycle,...)
Then the server serializes the name of the Class on the server side and then the data. 
In your model an the ActionScript side, you can add RemoteClass metadata to tell Flash/Flex that whenever an object with that name comes, that it should use this class for the ActionScript side.

Eventually you have to register the model class with:
flash.net.registerClassAlias({server-side classname}, {ActionScript class});

But usually the Flex compiler will handle that automatically.

Chris

________________________________________
Von: mark goldin <ma...@gmail.com>
Gesendet: Montag, 27. April 2015 17:43
An: users
Betreff: Cast results from server

I am getting data from a server as an ArrayCollection of a server class
objects.
How can I cast each element into a class that I am defining in ActionScript?

Thanks