| Key points: |
- If your server-side class implements the IWebORBArrayCollection interface, then WebORB will serialize it to the client as an ArrayCollection.
- In the server-side code, see:
- Lines 133-153: Definition of the PersonnelRecordArrayCollection2 class as implementing IWebORBArrayCollection. IWebORBArrayCollection has no methods, so declaring it implementes it.
- Lines 50-54: GetAllPersonnelRecordsAC2() returns a PersonnelRecordArrayCollection2.
- Line 21: Definition of 'personnelAC2' as a PersonnelRecordArrayCollection2 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 GetAllPersonnelRecordsAC2().
- main.mxml, lines 56-59: defines the DataGrid control. Note that it binds its dataprovider directly to the model's GetAllPersonnelRecordsAC2Result. 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, GetAllPersonnelRecordsAC2Result was just an Array, but in this sample, it's an ArrayCollection.
|