skip to main content
OpenEdge Development: ADM and SmartObjects
SmartLinks : SmartLink events
 
SmartLink events
For each SmartLink type, the source and target objects have specific responsibilities to each other. These responsibilities are fulfilled by the methods contained in the SmartObject; therefore, the type of links a particular SmartObject can support is determined by the methods it contains.
The specific responsibilities of a pair of linked SmartObjects to each other depend only on the type of SmartLink that connects them, not on their object types. For example, in a TableIO relationship, the target object always has the same responsibilities, regardless of whether it is a SmartDataBrowser or a SmartDataViewer. Specifically:
*A source object PUBLISHes named events to which its target object must SUBSCRIBE and for which the target object must implement event procedures that execute when PUBLISHED events occur.
*The target object PUBLISHes named events to which its source object must SUBSCRIBE and for which the source object must implement event procedures that execute when PUBLISHed events occur.
The source and target objects, therefore, must SUBSCRIBE to the correct set of events, or they cannot interact as expected. These events evaluate to the internal procedures in the source and target objects.
Subscription occurs when you add the SmartLink: the addLink procedure (in smart.p) SUBSCRIBEs the target procedure to the SourceEvents for the link and SUBSCRIBEs the source procedure to the TargetEvents, as shown in the following code fragment:
 
/* SUBSCRIBE to all the appropriate events on each side of the link. 
     First SUBSCRIBE the target to all the events it says it wants
     from its source. */
  cEvents = DYNAMIC-FUNCTION("get":U + pcLink + "SourceEvents":U IN phTarget) 
    NO-ERROR.
  IF cEvents NE ? THEN
  DO iEvent = 1 TO NUM-ENTRIES(cEvents):
    SUBSCRIBE PROCEDURE phTarget TO ENTRY(iEvent, cEvents) IN phSource.
  END.
  /* Then SUBSCRIBE the source to all the events (if any) that it wants
     from its target. */
  cEvents = DYNAMIC-FUNCTION("get":U + pcLink + "TargetEvents":U IN phSource) 
    NO-ERROR.
  IF cEvents NE ? THEN
  DO iEvent = 1 TO NUM-ENTRIES(cEvents):
    SUBSCRIBE PROCEDURE phSource TO ENTRY(iEvent, cEvents) IN phTarget.
  END.
 
  RETURN.
END PROCEDURE.
This behavior happens automatically, in the addLink procedure.
For more information on PUBLISH and SUBSCRIBE, see OpenEdge Development: ABL Reference. For a description of dynamic-function, see OpenEdge Development: ABL Reference.
The following sections describe the responsibilities of the source and target SmartObjects for each ADM‑recognized SmartLink type. For each SmartLink type, these sections also list the subscribed events/internal procedures required by the source and target objects.
Container SmartLink
The Container SmartLink’s source object can create and destroy its target objects. During creation, the source can tell its targets to set their positions relative to the source (if the targets have visualizations).
The source also can tell its targets to parent themselves to the source. If the source is hidden, viewed, or deleted, all its targets also are hidden, viewed, or deleted; this is standard Progress behavior.
To maintain a Container SmartLink, the ADM requires the source and target objects to SUBSCRIBE to and implement the events shown in Table 3–2. Specifically:
*The Container-Target SUBSCRIBEs to the source events in the Container-Source procedure handle and must implement the corresponding internal procedure names.
*The Container-Source SUBSCRIBEs to target events in the Container-Target procedure handle and must implement the corresponding internal procedures.
 
Table 3–2: Container events 
ContainerSourceEvents
ContainerTargetEvents
initializeObject
hideObject
viewObject
destroyObject
enableObject
confirmExit
exitObject
A Container SmartLink typically connects the following types of SmartObjects:
*Source — SmartWindow, SmartFrame, SmartDialog
*Target — Any SmartObject
Navigation SmartLink
The Navigation SmartLink’s source object can send navigation requests to its target objects. The source can also manage an interface for navigation (such as First, Next, Prev, and Last buttons).
To maintain a Navigation SmartLink, the ADM requires the source and target objects to SUBSCRIBE to and implement the events shown in Table 3–3. Specifically:
*The Navigation-Target SUBSCRIBEs to the source events in the Navigation-Source procedure handle and must implement the corresponding internal procedure names.
*The Navigation-Source SUBSCRIBEs to target events in the Navigation-Target procedure handle and must implement the corresponding internal procedures.
 
Table 3–3: Navigation events 
NavigationSourceEvents
NavigationTargetEvents
fetchFirst
fetchNext
fetchPrev
fetchLast
startFilter
queryPosition
updateState
linkState
filterState
The Navigation SmartLink typically connects the following types of SmartObjects:
*Source — Navigation SmartPanel, SmartToolbar
*Target — SmartDataObject
Page SmartLink
The Page SmartLink’s source object can inform its target object that a new page has been selected. The source also can manage an interface for selecting pages (such as tab folders).
To maintain a Page SmartLink, the ADM requires the source object to SUBSCRIBE to and implement the events shown in Table 3–4. Specifically, the Page-Source SUBSCRIBEs to target events in the Page-Target procedure handle, and must implement the corresponding internal procedures.
 
Table 3–4: Page events 
PageSourceEvents
PageTargetEvents
– (None)
changeFolderPage
deleteFolderPage
The Page relationship typically connects the following types of SmartObjects:
*Source — SmartFolder
*Target — SmartContainer, SmartWindow, SmartFrame, SmartDialog
PageN SmartLink
The PageN SmartLink’s source object can manage a set of pages. The target object is expected to have hide and view capabilities.
The PageN SmartLink has no PageN events—neither source events nor target events.
Note: Application developers do not normally use the PageN link type. Instead, the ADM maintains this link type, to identify which objects are on which page of a container for the purposes of hiding and viewing objects, and so on.
TableIO SmartLink
The TableIO SmartLink’s source object can tell its target objects to perform record modifications.
To maintain a TableIO SmartLink, the ADM requires the source and target objects to SUBSCRIBE to and implement the events shown in Table 3–5. Specifically:
*The TableIO-Target SUBSCRIBEs to the source events in the TableIO-Source procedure handle, and must implement the corresponding internal procedure names.
*The TableIO-Source SUBSCRIBEs to target events in the TableIO-Target procedure handle, and must implement the corresponding internal procedures.
 
Table 3–5: TableIO internal procedures 
TableIOSourceEvents
TableIOTargetEvents
addRecord
updateRecord
copyRecord
deleteRecord
resetRecord
cancelRecord
updateMode
queryPosition
updateState
linkState
The TableIO SmartLink typically connects the following types of SmartObjects:
*Source — Update SmartPanel, SmartToolbar
*Target — SmartDataViewer, SmartDataBrowser
GroupAssign SmartLink
The GroupAssign SmartLink’s source object can tell its target objects to either commit or not commit record modifications as part of a single transaction.
To maintain a GroupAssign SmartLink, the ADM requires the source and target objects to SUBSCRIBE to and implement the events shown in Table 3–6. Specifically:
*The GroupAssign-Target SUBSCRIBEs to the source events in the GroupAssign-Source procedure handle, and must implement the corresponding internal procedure names.
*The GroupAssign-Source SUBSCRIBEs to target events in the GroupAssign-Target procedure handle, and must implement the corresponding internal procedures.
 
Table 3–6: GroupAssign events 
GroupAssignSourceEvents
GroupAssignTargetEvents
addRecord
copyRecord
updateRecord
resetRecord
cancelRecord
enableFields
disableFields
collectChanges
updateState
The GroupAssign SmartLink typically connects the following types of SmartObjects:
*Source — SmartDataViewer
*Target — SmartDataViewer
Data SmartLink
The Data SmartLink’s source object can tell its target objects that a record is waiting in the data source.
To maintain a Data SmartLink, the ADM requires the source and target objects to SUBSCRIBE to and implement the events shown in Table 3–7. Specifically:
*The Data-Target SUBSCRIBEs to the source events in the Data-Source procedure handle, and must implement the corresponding internal procedure names.
*The Data-Source SUBSCRIBEs to target events in the Data-Target procedure handle, and must implement the corresponding internal procedures.
 
Table 3–7: Data events 
DataSourceEvents
DataTargetEvents
dataAvailable
queryPosition
deleteComplete
fetchDataSet
updateState
The Data SmartLink typically connects the following types of SmartObjects:
*Source — SmartDataObject
*Target — SmartDataObject, SmartDataViewer, SmartDataBrowser
Update SmartLink
The Update SmartLink’s source object can tell its target objects which fields have changed and supply the fields’ new values.
The ADM does not require the source and target objects to SUBSCRIBE to and implement any events. Instead, the Update relationship is maintained by the Update-Source directly running functions such as submitRow in the Update-Target.
The Update relationship typically connects the following types of SmartObjects:
*Source — SmartDataViewer, SmartDataBrowser
*Target — SmartDataObject
Commit SmartLink
The Commit SmartLink’s source object can tell its target objects to commit or undo the current transaction.
To maintain a Commit SmartLink, the ADM requires the source and target objects to SUBSCRIBE to and implement the events shown in Table 3–8. Specifically:
*The Commit-Target SUBSCRIBEs to the source events in the Commit-Source procedure handle, and must implement the corresponding internal procedure names.
*The Commit-Source SUBSCRIBEs to target events in the Commit-Target procedure handle, and must implement the corresponding internal procedures.
 
Table 3–8: Commit Events 
CommitSourceEvents
CommitTargetEvents
commitTransaction
undoTransaction
rowObjectState
The Commit SmartLink typically connects the following types of SmartObjects:
*Source — Commit SmartPanel, SmartToolbar
*Target — SmartDataObject
Filter SmartLink
The Filter SmartLink’s source object passes its filter data (operators and values) to the target object and removes filter data (for any field and operator combination that this source potentially can apply) in the target. When it finishes, the source opens its query. It reads the current operators and values from its target when it starts and whenever it is reset.
The ADM does not require the source and target objects to SUBSCRIBE to and implement any events. Only the source object knows about a filter relationship. The target object has no knowledge of the source object or why its activities are occurring.
The Filter relationship typically connects the following types of SmartObjects:
*Source — SmartFilter
*Target — SmartDataObject