Example name: WDMF: Updating a database record
Description: A trivial demonstration of WebORBData Management (WDM) for Flex (WDMF)'s approach to updating a database record.
Prerequisites:
Client-side code: Browse  Download
Server-side code: (All generated and deployed by WebORB)
Feature availability:
  • WebORB for .NET Development Mode
  • WebORB for .NET Community Edition
  • WebORB for .NET Enterprise Edition
Run example:
Key points:
  • All server-side code, wrapping the FoodAndDrinks database, was generated by WebORB, as shown in the prerequisite screencast.
  • WebORB also generated client-side code, in the FAD_Client package of the client's src package, to provide the client-side interface to the server-side database (FoodAndDrinks).
  • grdProducts.dataprovider is bound to ActiveRecords.Product.findAll() (see main.mxml, line 38), and all access to this data, in the UI, is through this dataprovider. See:
    • Line 47: data.save() saves the product indicated by 'data' (an element of grdProducts.dataprovider), which may be (or may not be) the currently-selected product.
    • Line 13-20: OnSave() saves the currently-selected product (see also Line 84, in which the button that calls OnSave() is defined).
    • The bi-directional binding of user interface elements, to keep them in sync; for example:
      • Line 60: TextInput txtName's 'text' field is bound to grdProducts.selectedItem.Name.
      • Line 25: grdProducts.selectedItem.Name is bound to TextInput txtName's 'text' field.
   
Things to try:
  • Study the MXML code carefully, to usnderstand the relationships among the controls and the DataGrid's DataProvider.
  • Delete the mx:Binding definitions (lines 24-27). What effect does this have on the sample's behavior?
See also:
Screencast: [none]
Errata:
  • None yet known.