skip to main content
OpenEdge Development: AppBuilder
Organizer Objects : Paging with SmartFolders
 
Paging with SmartFolders
The ADM SmartFolder object offers a convenient, popular way to develop a paged interface design. The SmartFolder implements the tabbed‑file‑folder metaphor with which most people who work in an office are familiar. The images in Figure 22 show the SmartFolder in use, managing the display of two pages in a toy contact‑management application.
 
 
Figure 22: Paging using a SmartFolder
While convenient to use and appropriate for many applications, SmartFolder may not be suitable for all cases. Although you can define up to 32 tabs, they will all be shown in a single line. This spares your users the disorientation of having tab rows re‑order themselves, but might require that they use a horizontal scrollbar.
To manage paging in your application using SmartFolder:
1. Sketch out the purpose and organization of each tabbed page. Keep in mind these points:
*There is no tab for Page 0. The leftmost tab always selects Page 1.
*Non-Smart objects will always be visible by default, regardless of the tab selected. They always reside on Page 0, and objects on Page 0 are always visible unless you add special code to manage the situation.
*If your design requires that you place non‑Smart objects within the perimeter of the SmartFolder, you might need to treat them in a special way.
For example, a rectangle cannot be placed directly on the surface of a SmartFolder—it sinks below the surface and cannot be seen. Nor can it be brought to the surface using LayoutMove‑to‑Top. To use a rectangle for visual organization, you must first place a borderless (thus invisible) frame object, with its Scroll Bars option turned off, on the SmartFolder. Then place the desired rectangle on the frame. The frame will keep the rectangle from sinking through the SmartFolder. (You should probably avoid placing non‑Smart objects within the SmartFolder if you can.)
2. Be sure that your workspace is a SmartWindow, SmartDialog, or SmartFrame. No other organizer object will support ADM paging.
3. Set your Design Page to 0.
Caution: Since nested paging is not possible—ADM supports only a single set of pages for any single SmartContainer—the SmartFolder must always reside on Page 0. If you place the SmartFolder on, for example, Page 1, it will abruptly disappear from view the moment you select the tab for any other page.
4. Click the SmartFolder icon in the Object Palette.
5. Move your cursor over an empty spot on your workspace, and click again to place the new SmartFolder, as shown:
6. An Advisor dialog box will appear, offering to create a Page SmartLink between the Smart workspace and the new SmartFolder object. Examine the offer, and accept it if it seems appropriate.
The Page link allows the SmartFolder to tell the Smart organizer which page to display when the user selects a tab. For more detailed information about SmartLinks and their meanings, see OpenEdge Development: ADM and SmartObjects.
7. If necessary, click on the SmartFolder to reveal its handles (you can see them illustrated in Step 5). Use the handles to adjust the size and position of the SmartFolder appropriately.
8. Click Menu on the SmartFolder and choose Instance Properties. The SmartFolder Properties dialog box appears:
*Enter the labels for the tabs you will use. To move to a new field, click Insert. If you wish to insert a field before the current field, use the UP–ARROW key. To remove an entry, click Remove.
*If you wish to use a special font for the tab labels, click Font and select a font in the dialog box that opens in response (see the “Text style selector and editor” section for more information.)
*By default, the width of the each tab agrees with the label; tabs are not of fixed size. If you prefer fixed‑size tabs (shown in Figure 22), check the appropriate box and enter a size for the tab. You may need to experiment to achieve a pleasing effect.
When you have finished configuring the tabs and their labels, click OK to dismiss the dialog.
9. Set the Design Page to 1 (remember: the leftmost tab selects Page 1, not Page 0). Place and arrange the SmartObjects belonging to Page 1. To control how the objects layer on top of one another, use LayoutMove‑to‑Top and LayoutMove‑to‑Bottom. Check to be sure this is effective: not all objects respond to relayering requests.
Note: Remember that only SmartObjects can participate in ADM paging. If your layout includes non‑Smart objects, they will remain visible regardless of the tab selected.
10. Repeat Step 9 for each succeeding page you defined, being sure to set the Design Page correctly each time before beginning to place objects. If you make a mistake, open the Pages dialog and move the misplaced objects to the correct page. See the “ADM pages manager” section for more information.
11. Set your Startup Page to the appropriate nonzero number, generally 1. Save your work.