Release 10.1A: OpenEdge Development:
Progress Dynamics Basic Development

> ## Links maintenance

> SmartObjects communicate by means of named connections that in the ADM are called SmartLinks. A SmartLink is nothing more than a collective name for a set of named events. They can be published (using the Progress™ 4GL `PUBLISH` statement) by the initiator, or Source, of the event. They are subscribed to (using the Progress 4GL `SUBSCRIBE` statement) by one or more targets for the event. As the designer of a window (or in this case, a container for many windows of a type), you need only name the source and target objects and the name of the link between them. The standard ADM code handles all the setup needed for the objects to communicate. If you are not familiar with the ADM, you can read more about this mechanism in the documentation. Some new links defined for the Progress Dynamics framework are described in the "New Progress Dynamics SmartLinks" section.

> After you select all the objects that are in the window or page, you must define all the links between objects in the container. The links will be made between the objects in the container; when a specific window or page is built from the container, these same links will be created between the actual application objects the application assembler chooses.

> The standard Repository includes template objects, and templates for windows and pages with links already defined. You only need to go through the process of creating a new layout if none exists already for the combination of objects you need. Once you have defined it, any developer who wants to assemble an application can build windows from it without understanding or modifying the specifics of the object positions, links, etc.

> ##### Links Maintenance tool

> The Links Maintenance tool is used to manage all links on the container between all instance objects and the container itself. Filtering and sorting of links can be done quite intuitively using the tools provided. By clicking on any one of the column headers, a browser’s details will be sorted by that particular field. A special filtering tool has been provided to allow only a selected list of links to be displayed.

> Filtering links is made possible by a combination of combos. This works exactly like the standard AppBuilder Links window works. Besides being able to filter on source, target, and link type, you can also see links pertaining to a specific object—whether it is the target or source—using the To / From field.

> Figure 8–17 shows the Links Maintenance window. Another useful option is to filter links by folder page.

> Figure 8–17: Links Maintenance window

> ##### Adding/assigning links

> Add links to provide IO for the new objects.

> | To add or assign a link:

> 1. Click the Add button.

> 2. Select the source, link, or target for the link. If, for example, the required object is not in the source list, click on the Filter from source, Filter from link, or Filter from target button to reveal all possible sources for links. This works for all three columns. Whichever item is selected from any column, the other two are dynamically updated to show only allowable items. This is based on the data in the ryc_supported_link table. Again, the red check mark indicates which component is currently active.

> 3. Select the other two components of the link.

> 4. Click Save. The browser is updated and the latest record is added.

> ##### Maintaining links

> Links can be edited and deleted using the maintenance tool. By simply selecting the link from the browser, the columnar link details section is dynamically updated with the specific link’s details. Select the Modify button to enable the columns. Here, the source, target, or link type can be changed. Remember to click on Save for the change to take effect.

> To delete a link, again, simply select it from the browser and click the Delete button.

> ##### New Progress Dynamics SmartLinks

> Most of the links are standard ADM SmartLinks. A few new ones have been added beyond those described in the documentation. This section describes the following new SmartLinks:

> - ContainerToolbar link — The framework supports many additional toolbar-launched functions and the standard Version 9 SmartObjects. To initiate events, the Toolbar event is published along the ContainerToolbar link and passes the function name to its container or contained object. S, for a toolbar that supports any additional functions (including invoking Notepad, a Calculator, an Internet connection, e-mail, the Re-Logon function, and so on) there is routinely a ContainerToolbar link from a toolbar to its container. Whenever the user invokes a function in the toolbar by choosing its button, the toolbar publishes the Toolbar event and passes the name of the function as an input parameter. Code in the standard super procedure for Containers, `src\adm2\containr.p`, receives the Toolbar event and runs the correct code.

> With earlier versions of Dynamics, both browsers and containers could have used the toolbar link and could have been toolbar-targets. The ContainerToolbar link is now used to prevent ambiguity and make defining enable rules for toolbar actions easier. Toolbar links to containers now use the ContainerToolbar link. The ContainerToolbar link has four new attributes:

> - `ContainerToolbarTargetEvents` (toolbar class)
> - `ContainerToolbarTarget` (toolbar class)
> - `ContainerToolbarSourceEvents` (container class)
> - `ContainerToolbarSource` (container class)
> - You can also create Toolbar links from datavisual objects (browsers and viewers) in the same window. The standard support procedure for datavisual objects, the super procedure `src\adm2\datavis.p`, likewise has a toolbar procedure to receive the Toolbar event, along with a parameter naming a specific function to be processed by the Browser. The functions are supported by several different toolbar bands described in the "Standard toolbar objects" section. They include access to Comments, Audit, Data Export, Print preview, Data Filter, and Find. If the toolbar you use supports any of these operations on the current record in a browser or viewer, then there should be a Toolbar link from the Toolbar to the browser or viewer in your layout.
> - Toolbar link — The `toolbar` link is in the `datavis` class to support browse toolbar actions such as Filter Find Export to Excel for viewers.

> Action rules for toolbars follow this logic:

> - Browse toolbar `tableio` actions have the same record state enable rule as standard toolbar `tableio` actions plus an additional rule to check whether `FolderWindowToLaunch` is not blank.
> - `Comments/Auditing/Status/Print/Export` have record available enable rules.
> - `AuditEnabled` attribute has been added to SDO and is used in audit action enable rule.

> A toolbar linked to a data visual object refreshes often to apply these new rules.

> - ToggleData link — Use the `ToggleData` link to enable records in a parent browser in one window to be browsed independently of the display of records in a dependent child browser. It effectively disables the Data link from parent to child so that data for the dependent query is not constantly fetched from the server as the user browses through different records in the parent query. When a parent record is explicitly selected (by double-clicking on it, for example), a new child window with the browser for that record’s child records is displayed. It keeps these two windows independent once the user initiates the child window. If the user explicitly selects a new parent record, a new child window is displayed for it. It is also made between the browser in the child window and its container window. However, the `ToggleDataTargets` property should generally be used in preference to this link, as described in OpenEdge Development: Progress Dynamics Advanced Development .

> - Primary SDO link — Where there is more than one SmartDataObject™ in a window or page, the `PrimarySDO` link tells its container which SDO is to be used as the target for a `Data` pass-through link from another window or page. The pass-through link establishes a connection between an SDO and its query in one window and a dependent SDO and its query in a second window. Although the `PrimarySDO` link is strictly necessary only when a window or page actually contains two potential `Data Targets` for a `Data Source` in another container, it is customary to define the `PrimarySDO` link so as to eliminate any chance of confusion as to where the path of the `Data` links should go. The `PrimarySDO` link goes from a contained SDO to its container.

> - TreeFilter link — The `TreeFilter` link was created to allow the dynamic TreeView object to have filtering capabilities. This link is added automatically when creating a new dynamic TreeView with a filter viewer associated with it.

> ##### The Object Locator tool

> This special tool allows you to find an object instance anywhere on a container and is particularly useful with multi-page containers. It has been included on the container builder as well as on the Links Maintenance tool, where finding an object instance is sometimes necessary.

> Some advanced filtering tools have been provided to facilitate easy searching for object instances, as shown in Figure 8–18.

> Figure 8–18: Object Locator window

> Based on the filter selections, the browser displays the objects that satisfy the criteria.

> ##### The Foreign-Field Mapping dialog box

> In the instances section of the Container Builder, there is a button (...) to the right of the Foreign Fields field. Click this to display the Foreign Fields Mapping dialog box, as shown in Figure 8–19.

> Figure 8–19: Foreign-Field Mapping dialog

> Use this dialog box to explicitly map SDO and SBO source and targets. Select one field in each list and choose Map. The list at the bottom shows the fields that are currently mapped. Choose one and click Unmap to undo the mapping.

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