radioGroup - Radio Button Group

Displays multiple buttons that can be selected or cleared. Only one button in the group can be selected.

Category

Core Controls

Syntax

<xp:radioGroup attributes>content</xp:radioGroup>
Table 1. Embedded controls
Control Description
selectItem Provides one item for user selection.
selectItems Provides one or more items for user selection.
Table 2. Essential properties
Property Description
id Defaults to radioGroup1, radioGroup2, and so on.
text Provides a label.
value Binds the control to a data element or other value.
legend Provides a screen readable group description.
Table 3. All properties
Category Properties
accessibility accesskey, legend, role, tabindex, title
basics attrs, binding, dir, disabled, id, immediate, lang, loaded, readonly, rendered, rendererType, required
data converter, defaultValue, disableClientSideValidation, disableModifiedFlag, disableValidators, showReadonlyAsDisabled, validator, validators, value, valueChangeListener, valueChangeListeners
dojo dojoAttributes, dojoType
events onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup
format border, layout
styling disabledClass, disableTheme, enabledClass, style, styleClass, themeId

Usage

At run time, one or more radio buttons appear on the page. The user can select one button. When a button is selected, any other button selected is cleared.

For accessibility compliance, you must specify the legend property.

Examples

This Radio Button Group control presents two items for selection.
<xp:radioGroup id="radioGroup1" legend="Select fruit" value="#{document1.fruit}" layout="pageDirection">
	<xp:selectItem itemLabel="Apples" itemValue="apples"></xp:selectItem>
	<xp:selectItem itemLabel="Oranges" itemValue="oranges"></xp:selectItem>
</xp:radioGroup>
This Radio Button Group control presents two items for selection using a formula.
<xp:radioGroup id="radioGroup1" legend="Select fruit" value="#{document1.fruit}"
	layout="pageDirection">
	<xp:selectItems>
		<xp:this.value>
			<![CDATA[#{javascript:return new Array("Apples|apples", "Oranges|oranges")}]]>
		</xp:this.value>
	</xp:selectItems>
</xp:radioGroup>
This Check Box Group gets its item selections from the values in a view column.
<xp:radioGroup id="radioGroup1" legend="Select fruit" value="#{document1.fruit}"
	layout="pageDirection">
	<xp:selectItems>
		<xp:this.value>
			<![CDATA[#{javascript:var list = @DbColumn("", "fruits", 1);
			return @Explode(list,",")}]]>
		</xp:this.value>
	</xp:selectItems>
</xp:radioGroup>