Progress
ADM 2 Guide


Using GroupAssign SmartLinks

GroupAssign SmartLinks are intended for grouping updates in multiple SmartDataViewers into one transaction. To do this, you link a master SmartDataViewer to the SmartDataObject with an Update SmartLink, then use GroupAssigns to link this SmartDataViewer to the other SmartDataViewers that will be grouped with it. When the updateRecord procedure executes the collectChanges procedure runs for the master SmartDataViewer in order to collect changed field values from all of its GroupAssign–Targets. The collected changes serve as the input to the submitRow procedure in the data source that updates the database.

Figure 6–6 illustrates this process (the arrows indicate SmartLinks).

Figure 6–6: Grouping Updates with GroupAssign SmartLinks

Note the SmartLinks in Figure 6–6:

The following example, which uses the Customer table in the Progress sample database, links various SmartDataViewers with GroupAssign SmartLinks so that the application can update a single customer record across multiple SmartDataViewers. Follow these steps:

  1. Create a SmartDataObject for the Customer table.
  2. Create a SmartDataViewer for the Customer table that contains the following fields:
    • CustNum
    • Name
    • Contact
    • Phone
    • Fax
    • EmailAddress
    • Name this SmartDataViewer vcustcontact.w. This is the master SmartDataViewer.

  3. Create a second SmartDataViewer for Customer table that contains the following fields:
    • Address
    • Address2
    • City
    • State
    • PostalCode
    • Country
    • Name this SmartDataViewer vcustaddress.w.

  4. Create a SmartWindow and on it create a SmartFolder with two tabs, labeled Contact and Address.
  5. Drop the SmartDataObject onto the window.
  6. Drop the vcustcontact.w SmartDataViewer (the master SmartDataViewer) onto page 1 of the SmartWindow and link it to the SmartDataObject with Data and Update links.
  7. Drop the vcustaddress.w SmartDataViewer onto page 2 of the SmartWindow and add SmartLinks as follows:
    • A Data link from the SmartDataObject to this SmartDataViewer
    • A GroupAssign link from the vcustcontact.w (master) SmartDataViewer to this SmartDataViewer.
  8. Drop an Update SmartPanel onto page 0 of the window and link it to the vcustcontact.w (master) SmartDataViewer.

When this application is run, it can make updates to a single record through both SmartDataViewers. These updates are saved together, updating the database with all changes to a single customer record in one transaction.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095