Radio (element)
Radio element belonging to a group of radio elements.
Properties
| Property | Description |
| Caption | String providing a caption for the component. |
| Enabled | Boolean indicating whether or not the component is enabled. |
| GroupName | Specifies the name of the radio group to which the element belongs. That name is only evaluated during compilation, and so is constant during execution. |
| Hint | Specifies the user hint string that will appear in the component's interactive help bubble. |
| ShowRadio | Boolean indicating whether or not to display the radio element's glyph. |
| TabIndex | Integer indicating the component's tab order (Qubes 5.6). |
| ValueChecked | Indicates the component's value when the element is selected/checked. |
| ValueInitial | Determines the component's initial value when the screen opens and each time it is reset (see Reset Button). |
| ValueUnchecked | Indicates the component's value when the element is not selected/checked. |
| Visible | Boolean indicating whether or not the component will be visible. |
Value
Within a group of radio elements (that share the same GroupName), only one element can be selected/checked at any given time.
When a element is checked, its cell value is ValueChecked; otherwise, it will be ValueUnchecked.
You can set a default value using the ValueInitial attribute.
All empty values and values other than that of the ValueChecked attribute will be considered as "unchecked by default."
If several radio elements with the same GroupName have an initial value that is checked by default, Qubes will only keep one of them, chosen at random (so this should be avoided).
At setup, it is possible that no radio element is checked by default for a given GroupName.
But once an option has been chosen, you can never revert to that initial state.
Remarks
Radio elements are used to choose one and only one option from among two or more choices.
All of the possible options are visible on the screen at the same time.
If there is a large number of options, a drop-down list might be more appropriate.
If you only have two binary options, a checkbox might be a better alternative.
Starting in Qubes 6.1, radio elements are styled and have the same font size.
In earlier versions, they used the browser's default style, and so (usually) had a fixed size unrelated to the font.
Each element's individual value can be retrieved by querying the cell.
But if you are interested in the values of all of a group's elements, you can set up the following configuration:
- Define a named range that covers all of the group's radio elements MyGroup).
- Give each element of the group its own ValueChecked and an empty ValueUnchecked.
- Assign the group's elements the same initial value, for example, taken from input data.
- Give the group's output data the following formula: =JOIN('', MyGroup)