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 Customer SmartDataObject is linked to each Customer SmartDataViewer with a Data SmartLink.
- The master SmartDataViewer is linked to the SmartDataObject with an Update link.
- The master SmartDataViewer is linked to each of the other SmartDataViewers, in a star pattern, with a GroupAssign SmartLink.
- The Update SmartPanel is linked to the master SmartDataViewer with a TableIO SmartLink.
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:
- Create a SmartDataObject for the Customer table.
- Create a SmartDataViewer for the Customer table that contains the following fields:
- Create a second SmartDataViewer for Customer table that contains the following fields:
- Create a SmartWindow and on it create a SmartFolder with two tabs, labeled Contact and Address.
- Drop the SmartDataObject onto the window.
- 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.- Drop the
vcustaddress.w
SmartDataViewer onto page 2 of the SmartWindow and add SmartLinks as follows:- 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 |