skip to main content
OpenEdge Development: AppBuilder
Data-Display/Capture Objects : Radio button sets
 
Radio button sets
The radio‑set widget provides a way to force a single choice from a small set of possibilities. Unlike a logical set that you might construct using toggle boxes, a radio-button set must always have exactly one member—no more, no fewer—selected. Thus, you cannot use radio button sets when you wish to allow no selection or multiple selection.
The radio set widget will represent a value of any standard type, including CHARACTER. Typically, though, you would use a radio button set for values that are basically nontext-numeric, symbolic-in nature.
By default, AppBuilder supplies a set of three buttons, arranged vertically. Using the property sheet, you can easily change the orientation to horizontal, and increase or decrease the number of members in the set.
Creating a radio-set instance
Because the radio-set widget is a basic ABL object, creating one is very simple.
To create a radio-set widget:
1. Click Radio Set in the Object Palette.
2. Move the mouse cursor over a bare spot in your workspace and click to place the new object:
3. Configure and size it. Note that you can change the spacing between the buttons by dragging the group handles.
Configuring a radio-set instance
To configure your radio-set object, begin by selecting it and choosing ToolsProperty Sheet. The Property Sheet dialog box appears:
Minimal configuration
Although you can accept many default settings, you should at least make the following changes:
*Object — Change the default identifier to one that more clearly reflects the role of this radio set in your application.
*Define As — By default, the radio-set widget represents a variable of type INTEGER. You can choose a different data type, if more appropriate. Open the drop‑down list and make your choice. Note that the button definitions in the list above this drop‑down change to agree with your choice here.
*Buttons — Each button is defined by a pair of values:
*Label string, delimited by double quotes
*Item value, consistent with the data type
Use a comma as separator between the label string and the item value, and between the item value for one button and the label string for the next button.
Changing the number of buttons is very simple. To make a set with fewer buttons, delete the unwanted value pairs. To make a larger set, add value pairs.
*Initial value — By default, the initial value is undefined. That might not be at all obvious because of the way a radio-button set displays itself. It is good programming practice to always explicitly initialize variables, but initialization is particularly important in such cases as this.
To set the initial value, click the Advanced button. When the Advanced Properties dialog box appears, type an appropriate value into the Initial Value field.
Help
You can add one or two types of help here:
*Tooltip — The radio button set will display this string whenever the user allows the mouse cursor to hover over the object’s frame.
*Help ID — If you plan to provide context‑sensitive help, type in a unique integer identifier.
Geometry
Reflects the XY origin and size, in character units, of the widget’s bounding box. By default, the object’s origin is considered to be the upper‑left corner. You can elect to have AppBuilder consider the origin to be the upper‑right corner instead, though this will not change the object’s position in any way.
For more information on all the settings on the property sheet, see the online help.
Advanced properties
A radio-set widget has only the standard advanced properties, but you can change those that do not meet your needs. See the “Advanced properties” section for more information.