RADIOGROUP item type

The RADIOGROUP item type defines a set of radio buttons.

Rendering


RADIOGROUP item type screenshot

Figure 1. RADIOGROUP item type

Syntax

RADIOGROUP item-tag = field-name [ , attribute-list ] ;
  1. item-tag is an identifier that defines the name of the item tag in the layout section.
  2. field-name identifies the name of the screen record field.
  3. attribute-list defines the aspect and behavior of the form item.

Attributes

COLOR, COLOR WHERE, COMMENT, DEFAULT, FONTPITCH, HIDDEN, INCLUDE, ITEMS, JUSTIFY, KEY, NOT NULL, NOENTRY, ORIENTATION, REQUIRED, SAMPLE, SIZEPOLICY, STYLE, TAG, TABINDEX, VALIDATE LIKE.

Table column only: UNSORTABLE, UNSIZABLE, UNHIDABLE, UNMOVABLE, TITLE.

Usage

The RADIOGROUP form item type defines a set of radio buttons where each button is associated with a value defined in the ITEMS attribute.

The text associated with each value will be used as the label of the corresponding radio button, for example: ITEMS=((1,"Beginner"), (2,"Normal"), (3,"Expert")) will create three radio items with the texts Beginner, Normal and Expert, respectively.

If the ITEMS attribute is not specified, the form compiler automatically fills the list of items with the values of the INCLUDE attribute, when specified. However, the item list will not automatically be populated with include range values (i.e. values defined using the TO keyword). The INCLUDE attribute can be specified directly in the form or indirectly in the schema files.

During an INPUT, a RADIOGROUP field value can only be one of the values specified in the ITEMS attribute. During an CONSTRUCT, a RADIOGROUP field allows to un-check all items (even if the field is NOT NULL), to let the user clear the search condition.

If one of the items is explicitly defined with NULL and the NOT NULL attribute is omitted; In INPUT, selecting the corresponding radio button sets the field value to null. In CONSTRUCT, selecting the radio button corresponding to null will be equivalent to the = query operator, which will generate a "colname is null" SQL condition.

Use the ORIENTATION attribute to define if the radio group must be displayed vertically or horizontally.

Some front-ends support different presentation options which can be controlled by a style attribute. You can for example define what item has to be selected firsts when pressing keys.

RADIOGROUP f001 = player.level,
  ITEMS=((1,"Beginner"),
         (2,"Normal"),
         (3,"Expert"));