skip to main content
OpenEdge Development: ADM and SmartObjects
SmartObjects : SmartContainers
 
SmartContainers
SmartContainers are ADM container-class objects that are designed to hold instances of other SmartObjects. There are four types of SmartContainers: SmartDataViewers, SmartDialogs, SmartFrames, and SmartWindows, each of which provides a different type of container widget. A SmartContainer can hold any other SmartObjects, including other SmartContainers; however, SmartDataViewers are intended to contain very specific types of objects. See the “SmartDataViewers” section for details.
When you build a Progress application, the step immediately after creating your SmartObject masters is to build an application screen. The first step in assembling this screen is to open a SmartContainer. You then insert instances of SmartObjects into the SmartContainer and link them together to produce your application screen.
SmartContainers have three important functions in a SmartObject application:
*Creating, initializing, and destroying their contents
*Managing paging
*Defining links between SmartObjects
The following sections describe these functions, as well as the SmartWindow, SmartFrame, and SmartDialog types of SmartContainers. Because the SmartDataViewer is a highly specialized type of SmartContainer, it is described separately in the “SmartDataViewers” section.
SmartContainers and their contents
All SmartObjects that a SmartContainer contains are linked to it by a Container SmartLink. (For more information, see Chapter 3, “SmartLinks.”) Figure 2–1 illustrates this relationship.
Figure 2–1: SmartContainer and contained SmartObject
The term SmartContainer suggests a visual relationship similar to that of a frame and the widgets inside that frame. This kind of relationship is typical between a SmartContainer and the object it contains. The container relationship extends beyond this, however, especially when a SmartWindow contains another SmartWindow. In this situation, although the two SmartWindows appear separately on your screen, the ADM parents one SmartWindow to the other. As a result, if you minimize or destroy the parent window, you also minimize or destroy the contained window.
The container relationship is, therefore, a logical relationship and not necessarily a visual relationship. Another example is a SmartContainer that contains a SmartDataObject. The SmartDataObject has no visualization, so at run time, you cannot see a visual relationship. Nevertheless, the SmartDataObject is contained in the SmartContainer.
At design time, when you insert SmartObject instances into a SmartContainer, the AppBuilder generates an adm-create-objects procedure in the SmartContainer. This procedure runs persistent instances of the SmartObjects contained in the SmartContainer and performs other initializations for those SmartObjects, such as setting their relative position, parenting them correctly to the SmartContainer, and adding links.
Paging
All SmartContainers can manage application pages: logical groupings of SmartObjects. When you select a given page, the ADM automatically hides all other pages (except page 0). Pages provide an easy‑to‑use mechanism for viewing and hiding objects, and help conserve screen space. For more information, see OpenEdge® Development: AppBuilder.
Pass-through links
A SmartObject inside a SmartContainer cannot link directly to a SmartObject external to the SmartContainer; however, you can create a link called a pass‑through link that allows the two objects to communicate. See the “Pass-through links” section.
SmartWindows
A SmartWindow is a SmartContainer that has a default frame and a window. A SmartWindow can be the main window of an application or a subwindow. It is an ADM container‑class object.
Table 2–2 lists the SmartWindow files.
 
Table 2–2: SmartWindow files 
File type
Filename
Template file
src/adm2/template/cntnrwin.w
Primary include file
src/adm2/containr.i
Main block include file
src/adm2/windowmn.i
SmartFrames
A SmartFrame is a SmartContainer that has a default frame but not a window. A SmartFrame groups logically related widgets (or SmartObjects) onto a frame that the AppBuilder can visualize in other SmartContainers. You also can use it to group SmartObjects into a single object that can be used as a logical unit. It is an ADM container-class object.
Table 2–3 lists the SmartFrame files.
 
Table 2–3: SmartFrame files 
File type
Filename
Template file
src/adm2/template/cntnrfrm.w
Primary include file
src/adm2/containr.i
SmartDialogs
A SmartDialog is a SmartContainer that has a default frame viewed as a dialog box and three default buttons: OK, Cancel, and Help. SmartDialogs are not designed to run persistently, be inserted in other SmartContainers, or have SmartLinks from other SmartObjects. Typically, you use a SmartDialog if you want to build a dialog box containing other SmartObjects or widgets. It is an ADM container‑class object.
Table 2–4 lists the SmartDialog files.
 
Table 2–4: SmartDialog files 
File type
Filename
Template file
src/adm2/template/cntnrdlg.w
Primary include file
src/adm2/containr.i
Main block include file
src/adm2/dialogmn.i