Workbench User Guide : 12. Working With Classes : Create a Display from a User Class
 
Share this page                  
Create a Display from a User Class
You can create a frame display that corresponds to the attributes of a user class. The simple attributes (attributes with simple data types) of the user class are displayed as fields with associated FreeTrim labels. The reference and array attributes are displayed respectively as panels containing simple fields derived from their simple attributes, and as TableFields containing columns derived from their simple attributes.
If the user class attributes were created using the Insert from Database Table facility in the Class Editor (or the attributes were subsequently given “category” tags), the fields created for these attributes are displayed in “category panels” that correspond to these categories. If, for the same reason, the attributes have “subtype” tags, the fields will be derived from corresponding FieldTemplates (those that were not will be standard EntryFields).
The layout of the panels is optimized to fit as closely as possible the dimensions of the Frame Editor that the fields are created in, with tablefields always at the bottom. If the fields cannot be arranged to fit the Frame Editor dimensions, precedence is given to deep displays, and the frame is made scrollable. To avoid or minimize this you can choose to display all the tablefields as successive pages in a single TabFolder at the bottom of the display, or display all object panels and TableFields as successive pages in a TabFolder with the simple elements of the business object displayed on the TabFolder's front page.
You can customize display generation in the following ways:
Choose one or more of the Advanced Options (Select a User Class Dialog).
Choose either the default Customize Options (Select a User Class Dialog)) or a CustomizeClass frame you have provided to adjust the userclass settings that affect the display generation.
Provide a custom procedure to refine the default layout algorithm.
Provide custom field templates to define over the default templates (see Define Your Own Layouts).
To create a display from a user class
1. Double-click the desired frame in the Workbench, or create a new frame.
The Frame Editor appears.
The FrameTemplate style you choose for the frame is not critical. However, a frame built from the active_display template will also include toolbars and code with the necessary triggers and calls—in a very small footprint—to handle display and change of business data, and some other standard functions, so that your frame is immediately ready to run. The active_display Template is provided with OpenROAD, or you can derive your own display templates from the active_display template by creating a frame from it and saving that frame as a new template, editing it afterward.)
2. Click Insert, Display from User Class.
OpenROAD displays the Select a User Class dialog that lists the user classes in the current application and all included applications.
3. Select the application that contains the business class to be displayed, then select that business class from the second list.
4. If necessary, click the Advanced Options (Select a User Class Dialog)) or Customize Options (Select a User Class Dialog)) link to set additional specifications.
5. Click OK.
OpenROAD creates a combination of simple fields and panels or table fields based on the attributes of the user class you specified, positioned at grid nodes, and laid out to occupy the same dimensions as the Frame Editor (to the extent possible). The simple fields have companion title fields and are grouped into named categories, and they have field types and property settings corresponding to the subtype (if any) they have been tagged with (for example, a Boolean subtype will be created as a ToggleField).
The fields on the display are not grouped within any hidden organizing CompositeFields (although where they correspond to attributes of an object attribute they will be within that attribute's CompositeField). Consequently they can be repositioned readily using standard OpenROAD editing facilities.
Note:  Private attributes are not used when creating a display from a user class.
6. If you used one a display frame template such as active_display, you can click Debug, Go (or press F5) to run the frame.
The frame will open with a menu and toolbar, and you can click the frame's File, Open option or suboptions to select and display one or all of the business objects of the type specified when building the display. Each business object is complete with instantiation of its simple attributes and class attributes, displayed as data in the CompositeField and TableField panels. Various additional options are provided to add, edit, and delete the displayed objects, to step through the set of objects (if Open All was chosen), and to navigate to open frames displaying the supplemental objects as required.