djCheckBox - Dojo Check Box

Accepts a check box as true or false.

Category

Dojo Form

Syntax

<xe:djCheckBox attributes>content</xe:djCheckBox>
Table 1. Essential properties
Property Description
id Defaults to djCheckBox1, djCheckBox2, and so on.
value Binds the control to a data element.

Usage

This is a Dojo control.

At run time, a check box appears on the page. If the user selects the box, its value is true. Otherwise its value is false.

This control is not tested against the latest accessibility standards. The recommended accessible path is the Check Box control.

Examples

This example consists of a Check Box bound to a scoped variable, a button for submitting the page, and a computed field that uses the value of the scoped variable.
<xp:table>
	<xp:tr>
		<xp:td>Check Box</xp:td>
		<xp:td>
			<xe:djCheckBox id="djCheckBox1" value="#{sessionScope.djCheckBox1}"></xe:djCheckBox>
</xp:td>
	</xp:tr>
	<xp:tr>
		<xp:td>
			<xp:button value="submit" id="button1">
				<xp:eventHandler event="onclick" submit="true" refreshMode="complete" immediate="false" save="true">
			</xp:eventHandler></xp:button>
		</xp:td>
		<xp:td></xp:td>
	</xp:tr>
	<xp:tr>
		<xp:td>Value</xp:td>
		<xp:td><xp:text escape="true" id="computedField1"><xp:this.value>
		<![CDATA[#{javascript:return "The box is " + (sessionScope.djCheckBox1 ? "" : "not ") + "checked."}]>
		</xp:this.value></xp:text></xp:td>
	</xp:tr>
</xp:table>