Progress
Programming
Handbook
Setting Up Dynamic Field-level Widgets
When setting up dynamic field-level widgets, it helps to keep these points in mind:
- Frame parenting — You can place a dynamic field-level widget in either a static or dynamic frame (see the "Setting Up Dynamic Frames" section). Assign the frame handle to the FRAME attribute of the field-level widget. For a field-level widget, the PARENT attribute points to the field group, not the frame, of the widget. Progress automatically puts the widget in a field group when you set its frame, and also assigns the widget a default tab position if it is an input widget.
- Widget positioning — To space them out in a frame, you must explicitly position all dynamic widgets by setting the appropriate vertical (ROW or Y) and horizontal (COLUMN or X) placement attributes. However, Progress does assume the top-most and left-most position in the frame if you do not set a placement attribute for the widget.
- Widget sizing — You can size a widget, depending on its widget type and data type, using either the various height and width attributes or the FORMAT attribute. For example, a fill-in field with its FORMAT attribute set to "x(20)" is exactly the same size as one with its WIDTH–CHARS attribute set to 20.
- Label handling — Not every field-level widget gets its label by setting the LABEL attribute. You must provide separate text widgets as labels for some data representation widgets. For side labels, you set the SIDE–LABEL–HANDLE attribute of the specified data representation widget to the handle of the text widget containing the label in its SCREEN–VALUE attribute. For any other type of label, such as for vertical columns, you must create and manage the text widget completely separately. You must also position text widgets used as labels explicitly, even for side labels. Progress assigns no positioning information for dynamic side labels, as it does for button or toggle box labels.
- Data handling — Unlike static data representation widgets, dynamic widgets have no field or variable implicitly associated with them. You must explicitly assign data between a widget’s SCREEN–VALUE attribute and the field or variable that you choose for data storage. Thus, you can use a single widget to represent several fields and variables at different times, depending on the widget and data type.
- Data typing — Some dynamic widgets support entry and display data types other than CHARACTER, and some, such as fill-in fields and combo boxes support the full range of Progress entry and display data types. Note that for dynamic widgets this support is for entry and display purposes only. The SCREEN–VALUE attribute always stores the data in character format, no matter what the widget data type. You must make all necessary data type conversions using the appropriate functions (STRING, INTEGER, etc.) when assigning data between the widget SCREEN–VALUE attribute and the field or variable that you choose for data storage.
The following procedure creates a dynamic fill-in with the INTEGER data type when you choose the Customer Number button. You can then enter a value according to the “>>>>9" format. The entered integer value is stored as a character string in the screen buffer. Pressing RETURN displays this value in the message area. Choosing the Delete Field button deletes the fill-in, removing it from the display:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |