|
The item may not be an instance of user,
but rather an anonymous Object that contains the correct properties that match
the public interface of the user class. The “as” operator returns null if the instance
cannot be coerced into the requested type… where as traditional casting syntax
will throw an error. You can use getQualifiedClassName or the “is” operator to
determine whether an instance is of a particular type before casting or using
the as operator. From: So, I've got an ArrayCollection and a defined value object.
The ArrayCollection has just one record in it, and the data matches the
valueObject perfectly. Here's my code: If I do this, everything works: model.currentUser.userID
= loginResult.getItemAt(0).userID; If I do EITHER OF THESE (not all at once), model.currentUser
remains NULL: 1 model.currentUser =
loginResult.getItemAt(0) as user; Any ideas what I'm doing wrong? Shan -- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS
|
- RE: [flexcoders] arrayCollection to custom value object Peter Farland
- RE: [flexcoders] arrayCollection to custom value object Shannon Hicks
- RE: [flexcoders] arrayCollection to custom value ob... Peter Farland
- RE: [flexcoders] arrayCollection to custom valu... Shannon Hicks
- RE: [flexcoders] arrayCollection to custom ... Peter Farland
- RE: [flexcoders] arrayCollection to cu... Shannon Hicks

