It means that the currentTarget.selectedItem isn't a vo_Task.  Sometimes
this happens because the data coming from the server wasn't property
converted to the type you wanted.  Make sure the data items you're
getting are in fact mapped to the right classes on both the server and
the client.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of jonese
Sent: Tuesday, April 29, 2008 10:15 AM
To: [email protected]
Subject: [flexcoders] Cannot convert Object to X

 

Hey all,

i have a function which takes in an Event. I then grab the
currentTarget.selectedItem which is an Object.

I need to turn this Object into a specific Value Object i created
called vo_Task.

I tried:
var thisItem:vo_Task = e.currentTarget.selectedItem;

and get the error:
"TypeError: Error #1034: Type Coercion failed: cannot convert
[EMAIL PROTECTED] to com.nucleusclient.roadmap.vo.vo_Task."

I tried
var thisItem:vo_Task = e.currentTarget.selectedItem as vo_Task;

but that just passes in a BLANK vo_Task

The properties of the currentTarget.selectedItem are identical (as far
as i can tell) to what should be found in a vo_Task.

Any ideas?
jonese

 

Reply via email to