checkBoxGroup - Check Box Group

Displays multiple boxes that can be selected or cleared.

Category

Core Controls

Syntax

<xp:checkBoxGroup attributes>content</xp:checkBoxGroup>
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
Category Properties
id Defaults to checkBoxGroup1, checkBoxGroup2, and so on.
value Binds the control to a data element or other value.
legend Provides a screen readable group description.

Usage

At run time, one or more check boxes appear on the page. The user can select or clear them. A check mark appears in a box when selected.

The data element bound to the check box must allow multiple values.

For accessibility compliance, you must specify the legend property.

Examples

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