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 2014/12/05 19:46:27 UTC
Receiving ObjectProxy
I am getting data from the server using Remoting. The code stopped working
and when I checked I noticed that it's casting that fails. further analysis
showed that instead of getting an object of a type I was casting to I am
getting a type of ObjectProxy. Why would I be getting ObjectProxy in a
first place?
Thanks for help.
Re: Receiving ObjectProxy
Posted by Alex Harui <ah...@adobe.com>.
If there is no registered class alias you get an object proxy.
Sent via the PANTECH Discover, an AT&T 4G LTE smartphone.
mark goldin <ma...@gmail.com> wrote:
I am getting data from the server using Remoting. The code stopped working
and when I checked I noticed that it's casting that fails. further analysis
showed that instead of getting an object of a type I was casting to I am
getting a type of ObjectProxy. Why would I be getting ObjectProxy in a
first place?
Thanks for help.
Re: Receiving ObjectProxy
Posted by CodeGirl <Mi...@yahoo.com>.
Also, check to see if there is only one record. I discovered some time ago
when I ask for a list from my web service but there was only one result
instead of a list that it failed. And so I had to test to see the result
was a list or not. If it was not a list, then I had to use the
event.result and assign each value to the object.
dataList = new ArrayCollection();
if (event.result != null)
{
if (event.result is ArrayCollection)
{
dataList = getAsResult.lastResult;
}
else
{
dataList.addItem(toDTO(event.result));
}
}
}
public function toDTO(o:Object):ADTO
{
var thisDTO:ADTO = new ADTO();
thisDTO.id = o.id;
thisDTO.name = o.name;
return thisDTO;
}
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Receiving-ObjectProxy-tp8989p9047.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.