--- In [email protected], "Derrick Anderson" <[EMAIL PROTECTED]> wrote: > > hi, i am trying to incorporate value objects into my programming- i have a > very simple one set up > > [Bindable] > public class EmployeeVO > { > public var employeeID:uint; > public var roleID:Number; > public var employeeTypeID:Number; > public var employeeStatusID:Number; > > and i'm trying to cast a datagrid item which contains these 4 values onclick > like: > > var testVO:EmployeeVO = DataGrid(event.currentTarget).selectedItem as > EmployeeVO; > > testVO is always null, and I can't figure out why. the selectedItem > properties are (as they are seen in debugger): > > employeeID = 1830 [0x726] > employeeStatusID = 2 > employeeTypeID = 1 > mx_internal_uid = "D3C...." > roleID = 3 > > can anyone see what i'm doing wrong here?
I don't think that the as operator actually MAKES the object into another data type. I think it just helps the compiler REALIZE it is that data type if the syntax is not clear. So your data grid's dataProvider would need to already contain some sort of collection of EmployeeVO's to begin with. HTH; Amy

