RadioButtonGroup UDR(3.3)

The RadioButtonGroup UDR is used to create a radio button group.

To create a radio button group with a default selected radio button as shown above, enter the following code.

// Create a radio button group RadioButtonGroup radioButton = udrCreate(RadioButtonGroup); radioButton.name = "color"; radioButton.label = "Select a color"; // Create a ordered map to control the order of the radio button radioButton.buttons = mapCreateOrdered(string, string); mapSet(radioButton.buttons, "Red", "red"); mapSet(radioButton.buttons, "Blue", "blue"); mapSet(radioButton.buttons, "Green", "green"); // The radio button with value red will be default selected radioButton.selected = "red";

The following fields are included in the RadioButtonGroup UDR:

Field

Description

Field

Description

attributes (map<string,string>)

This field may contain extra attributes to be added.

buttons (map<string,string>)

This field must contain a map of key value pairs. The key will be present on the label next to the radio button and the value will be set on the Value attribute. Meaning the value will be sent if the radio button is submitted in a Form UDR.

To get the items in the same order as added the map needs to be created with mapCreateOrdered function.

cssClasses (list<string>)

This field may contain a list of extra values added to class attribute. This is typically used to style the component. Please read more on Bootstrap.

It will be added to each radio div tag. Then it can be used to get a horisontal view by add form-check-inline.

disabled (boolean)

This field may contain a boolean if the component should be disabled or enabled.

id (string)

This field may contain the id of the component

label (string)

This field may contain the label for the radio button group.

labelCssClasses (list<string>)

This field may contain a list of extra values added to class attribute of the label. This is typically used to style the component. Please read more on Bootstrap.

name (string)

This field may contain the name of the component. If the component is present in a Form UDR(3.3), the name will be submitted with the form as the key in the Params Map in Request UDR(3.3).

required (boolean)

This field may contain a boolean if the component is required. Typically used inside a Form UDR.

selected (string)

This field may contain a string matching a value in the Buttons map. If a match is found this radio button will be selected.