I am trying to use the DAM library to access a list of Datacenter objects along with a list of Datastore objects that each one is associated with. I haven't found any documentation that talks about how to use model relations and arrays at the same time.
My data objects look like this (they are in packages, with imports etc) that compile cleanly.
[Bindable]
[Model(type="Datacenter")]
public class DatacenterDataItem extends DataObject {
[Model(property="name")]
public var name:String;
///[Model(relation="datastore", property="name")] // Works but only returns name
[Model(relation="datastore", nestedModel="com.example.model.DatastoreDataItem")]
public var datastoreList:ArrayCollection;
}
[Bindable]
[Model(type="Datastore")]
public class DatastoreDataItem extends DataObject {
[Model(property="summary.name")]
public var name:String;
[Model(property="summary.type")]
public var type:String;
[Model(property="summary.url")]
public var url:String;
}
When I try and query the list of datacenters the client blows up with a message box that says "An internal error has occured - Error #1065" so obviously something isn't correct.
I can return a list of names if I specify the property directly, however based upon the documentation it seems the nested object should work... Ideas?