Progress
ADM 2 Guide


Getting Records from an Additional Source

As with most other link types, it is valid for a Data–Target SmartObject to have only one Data–Source at a time. Sometimes, however, you must be able to pass a record down a different path than the normal Data link path. For example, suppose that you have a a SmartDataViewer that receives Customer values from a SmartDataObject. When the SmartDataObject is notified of the dataAvailable event, it gets the Customer values for the current row in the Customer SmartDataObject. This sequence is repeated whenever the SmartDataObject retrieves a new Customer record. However, the SmartDataViewer might occasionally need to get a different record. For example, it might need the User record on startup in order to perform security checks. This User record might not be available through its normal Data–Source.

You can deal with this scenario in a number of ways. In addition to the default automatic execution of the colValues function in the Data–Source from dataAvailable, you can program a SmartObject to run colValues in a SmartObject other than its regular Data–Source. This approach provides an ADM–standard way to get an extra set of values from one SmartObject to another. For example, you could define an initializeUser link from the source of the User ID to the SmartDataViewer that needs it. When you create a nonstandard link, Progress performs a single SUBSCRIBE in the Target for the link name. For example, if the initializeUser procedure is defined in the SmartDataViewer, it will be executed whenever the Source PUBLISHes the initializeUser event. The User ID can be passed as an argument or queried from Target to Source.


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