| Key points: |
- If your server-side class is a subclass of WebORBArrayCollection, then WebORB will serialize it to the client as an ArrayCollection.
- In the server-side code, see:
- Lines 106-124: Definition of the PersonnelRecordArrayCollection class as a subclass of WebORBArrayCollection.
- Lines 112-123: Constructor, initialized from an Array.
- Lines 43-47: GetAllPersonnelRecordsAC() returns a PersonnelRecordArrayCollection. (Notice that this method is different from GetAllPersonnelRecords(), lines 31-35, which returns an array.)
- Line 20: Definition of 'personnelAC' as a PersonnelRecordArrayCollection initialized with the 'personnel' Array.
- Lines 11-18: Definition of 'personnel' as a statically-initialized array of PersonnelRecord.
- Line 5: using Weborb.Types, which declares WebORBArrayCollection.
- In the client-side code, see:
- main.mxml, line 38: calls GetAllPersonnelRecordsAC() (note the 'AC' at the end).
- main.mxml, lines 56-59: defines the DataGrid control. Note that it binds its dataprovider directly to the model's GetAllPersonnelRecordsResult. It does not need to bind through an intermediary ArraCollection object, as the 'Binding data grid to array result' sample did. Why? Because in that sample, GetAllPersonnelRecordsResult was just an Array, but in this sample, it's an ArrayCollection.
|