skip to main content
OpenEdge Development: AppBuilder
Organizer Objects : Paging whole windows
 
Paging whole windows
You will find it easiest to construct an ADM‑based paging system if you design with a single SmartWindow in mind as the paging context. The examples above follow such a single‑window model.
If you are careful to design appropriately, you can construct a multi‑window application that uses ADM paging to control window display and hiding. Figure 25 shows a sample application in which the larger window is opened or closed by the buttons in the smaller window.
Figure 25: Paging a whole window
To reproduce the example shown in Figure 25:
1. Create a new SmartWindow. This will be the Work window. Populate it with a SmartDataObject, SmartDataViewer, and the two SmartPanels (navigate and update). Save this assembly under a distinctive name.
2. Create a second new SmartWindow. This will be the control window. Populate it with two buttons, using the View Page versions of the buttons for convenience. Change their labels appropriately.
3. Select the button that will open the Work window. Open the Section Editor and replace the call to viewPage(1) in the trigger code with a call to selectPage(1). Close the Section Editor window.
4. Set the Design Page to 1. Select the SmartContainer object tool from the Palette. When the Selection dialog box opens, choose the file that represents the Work window you created and saved in Step 1.
5. Place this object in the control window.
A SmartWindow placed in this way will not display its run‑time representation, but instead will present as a non‑visible SmartObject. This is as it should be—the Work window is an independent SmartWindow and thus has no code that would allow it to open within the control window as a component object. Within the control window, the Work window is indeed a non‑visible object.
6. Select the button that will close the Work window. Open the Section Editor and replace the call to viewPage(1) in the trigger code with a call to selectPage(32768). Note that the number need not be 32768—simply choose some distinctive, non‑negative integer that you are not using for an actual page number.
A call to selectPage( ) always turns off the old page before turning on the new one. However, since you have not defined a page 32768, there is no new page to turn on. So pressing this button will only have the effect of closing (turning off) the Work window.
7. Save the control window object. Run it, and choose the buttons to open and close the work window.