|
So, how can I get my ArrayCollection row into my object?
It's cool that I can test and see that it's not working using "IS", but it
doesn't solve the problem, just allows me to
trap it :)
Shan From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Farland Sent: Wednesday, July 05, 2006 10:07 PM To: [email protected] Subject: RE: [flexcoders] arrayCollection to custom value object
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
SPONSORED LINKS
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

