Progress
AppBuilder
Developer’s Guide
Creating a SmartDataViewer Master
The first step in defining a new SmartDataViewer master is always to identify the source of the data stream. Because of this dependency, you must first create your SmartDataObject, then create the SmartDataViewer. See the "Creating a SmartDataObject Master" section in "Data-access Objects," for information about that process.
AppBuilder supplies a Wizard to help with creating SmartDataViewer masters. The Wizard has four pages, only two of which involve significant work:
To create a SmartDataViewer master, follow these steps:
- Start the SmartDataViewer Wizard by clicking on the SmartDataViewer tool icon in the Object Palette:
![]()
When the Choose dialog box opens, choose New.
NOTE: You could also start the Wizard by choosing FileNew and selecting the SmartDataViewer item from the list, or by right-clicking the icon in the Palette and selecting New SmartDataViewer from the menu that appears.
- The SmartDataViewer Wizard starts up and displays its first page. When you have finished reading the introductory text, choose Next to move to Page 2:
![]()
- Choose the Browse button and select the appropriate SmartDataObject master. Its filename appears in the fill–in.
- Choose Next to move to Page 3:
![]()
- Choose the Add Fields button to open a Multi-Field Selector dialog box:
![]()
- The fields Available for display appear in the left-hand list. Select those you wish the SmartDataViewer to display and click the Add button to move them to the Selected list in the right-hand window. If you make a mistake, click the Remove button.
When you have finished selecting fields, you can reorder them using the Move Up and Move Down buttons. When they are in the order you want them displayed, choose OK. The Selector dialog box closes and the list of selected fields appears in the Wizard:
![]()
- Choose Next to advance to the Wizard’s final page. If you have successfully defined a data source and selected the fields to display, you will see “Congratulations!”. If you do not see that page, choose the Back button and make necessary changes.
- Choose Finish to dismiss the Wizard and reveal the new SmartDataViewer master, if it was not already visible:
![]()
- Fields in a SmartDataViewer are read-only unless you connect them to the appropriate TableIO source, such as an Update SmartPanel. If you do connect them to Update controls, then all fields become updatable unless you explicitly make them read-only.
To make any of the individual fields read-only, double-click on it to open its property sheet. When the Property Sheet dialog box opens, set the Read-only check box and choose OK.
Note the difference in how fields display at run time, depending on their state:
In the first case, there is no Update SmartPanel, and so all fields are read-only. The Fill–ins display their content without displaying themselves—the fields are not outlined or modelled in any way; they are invisible. All text looks static. This is the same effect you will get if you set the fields to be not-updatable in the SmartDataObject:
![]()
In the second case, there is an Update SmartPanel, and so all fields are updatable if they are updatable in the SmartDataObject. The Fill–ins display their content in the ordinary way:
![]()
In the third case, there is an Update SmartPanel, but the Name field has its Read-only property set. Here, the Name field is clearly in a different state to the others, and the experienced user will recognize that it is not editable. However, this style of presentation only applies where the field is updatable in the SmartDataObject, but set read-only in the Fill–in. If it is not updatable in the SmartDataObject, it appears as in the first example:
![]()
- Choose File
Save and give the new master a descriptive filename. Note that SmartDataViewer filenames conventionally begin with v. The new master object is now available for your use.
If you plan to replace one or more of the simple fields with SmartDataFields, do it now. See the "Placing and Configuring a SmartDataField Instance" section in this chapter for information about that process.
NOTE: Although SmartDataViewers can be members of the class SmartContainer, they are not organizer objects, so placing SmartObjects in them other than SmartDataFields is not supported. The only exception is that, if you replace one or more of the fields with SmartSelect objects, you can also include an equal number of SmartDataObjects to feed them.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |