Class: dbRadioGroup
Properties | Events | Methods | Index of Classes
Groups multiple radio objects in a visible object, providing selection of no more than one at a time
Hierarchy
cObject > cUIObject > DfBaseObject > DfBaseWindow > DfBaseUIWindow > DfBaseContainer > DfBaseGroup > Group > RadioGroup > dbRadioGroupDS > dbRadioGroup
Show full hierarchy and direct subclasses
Library: Windows Application Class Library
Package: DFEnRad.pkg
Mixins: Extended_DEO_Mixin, Extended_DEO_Status_Help_Mixin, Extended_DEO_Radio_mixin, Extended_DEO_Status_Help_Tooltip_Mixin
Description
dbRadioGroup is used to group multiple radio objects in a visible object, providing selection of no more than one at a time. The group represents the value of a single data-entry element. Each Radio object within the group represents a possible value for that data item.
Sample
Object Status is a dbRadioGroup
Set Size to 60 100
Set Location to 10 50
Set Label to "Customer Status"
Entry_Item Customer.Status
Object r1 is a Radio
Set Location to 10 10 // label provided by DD
End_Object
Object r2 is a Radio
Set Location to 25 10
End_Object
Object r3 is a Radio
Set Location to 40 10
End_Object
End_Object
Syntax
Use DfBase.pkg
Object oObjectName is a dbRadioGroup
Set Location to vertical horizontal
Set Size to height width
Entry_Item table.column
set Auto_Label_State to true | false
Set Label to "text"
Get/Set Changed_State
Object oRadioObjectID is a Radio
Set Location to vertical horizontal
End_Object
:
Object oRadioObjectID is a Radio
Set Location to vertical horizontal
End_Object
End_Object
Note
This class is a subclass of RadioGroup and inherits all of its behaviors and attributes.
An object of this class is associated with a single data element, which is assigned with the entry_item command. Each radio object within this object represents a valid value for the entry item. Each valid choice is defined with a data value (the value that is read and written to the database) and a description (the text value that is displayed with the radio object). These values are supplied automatically by the data dictionary, or they must defined within the object by the fill_list procedure.
Use with Data Dictionaries
Objects of this class are designed to be used most-effectively with a DataDictionary. This object is assigned to a table and column with this object's entry_item statement. The data dictionary will automatically provide a label for each child radio object and handle the interface between the DataDictionary and this object. It will also provide status help for this group.
The key is for the DataDictionary to provide the possible database values via a Validation Table. This can be defined in the DataDictionary modeler in the Studio by setting the Validation Type to validation object and connecting it to a (typically static) ValidationTable in the Column Validation dialog. When designing your radio group, you must know how many items will be supplied by the DataDictionary and create a child radio object for each item.
Radio Child Objects
The radio objects within this object are very simple. Normally, you only set their location. All other information is provided by this object. It is important that you create a radio object for each data value option (whether supplied by the data dictionary or through fill_list).
Note that an object of this class will contain objects based on the Radio class (there is no dbRadio class).
Data-entry Object
An object of this class is a data-entry object (DEO). A DEO is an object (in this case a RadioGroup) whose native capabilities are augmented with data-aware behaviors. These behaviors include: Finding, clearing, saving, and deleting of records (and sets of records) Prompt- and zoom-object support Change verification (save, delete, and data-loss verifications) Object and item entering, exiting, and validation Server support: DEOs connect to data-server structures These data-aware "skills" are added to all DEO classes through a series of mix-in classes. The messages are listed here but documented in the mix-in classes. You are encouraged to study the documentation of the mix-in classes. Information provided in these classes may be applied to all DEO classes (all db... classes). Those classes are: Nesting_Mixin, Navigate_Mixin, Verify_Mixin, Server_Mixin, Find_Edit_Mixin, Entry_Item_Mixin, DEO_Delegate_Mixin, Validate_Mixin and Clear_Defaults_Mixin.
Suitability of Radios for Data Entry
Radio objects are of limited use within data-entry views. They are static. You must know how many choices are available for an entry item and you must create a Radio object for each choice. If you add or remove a choice, you must redesign your screen to add or remove a Radio object. The dbComboForm represents a more-flexible method of presenting choices. In addition, groups of radio objects take up a relatively large amount of screen space. If a radio consists of only two choices, a dbCheckBox can more-effectively be used. If more than two choices are supported, a dbComboForm is more space-efficient.
For the above reasons, data-aware radio objects should be used judiciously.
Changing a Radio's Description
When using Radios with data dictionaries, each radio object's description is provided by the data dictionary. The label provided by the data dictionary or provided through fill_list will override any label you directly set in the radio object. If you wish to alter or override this label provided from the data dictionary, you have several choices: The dbRadioGroup's property Code_Display_Mode can be set to display the description (default), the code, or the code and the description.
Set Code_Display_Mode to CD_Display_Code
You can augment the function Code_Description_Value. This is passed the description value and the data value and returns the display value.
Function Code_description_value string DescVal string DataVal returns string
string sDisplayVal
Move (DataVal - ":" * Uppercase(DescVal)) to sDisplayVal
Function_Return sDisplayVal
End_Function
You can directly set the label within the radio objects and cancel the RadioGroup message set radio_value.
Procedure Set Radio_Value integer item# string Val
End_Procedure
Object R1 is a radio
set Location to 10 10
set Label to "Custom"
End_Object