Progress
AppBuilder
Developer’s Guide


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 3–12 shows a sample application in which the larger window is opened or closed by the pushbuttons in the smaller window.

Figure 3–12: Paging a Whole Window

To reproduce the example shown in Figure 3–12, follow these steps:

  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 Pushbuttons, 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.
  6. 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.

  7. 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.
  8. 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.

  9. Save the Control Window object. Run it, and choose the buttons to open and close the work window.

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