You can drag the Standard JavaServer Faces Checkbox component from the Palette's Standard category to the Visual Designer to create a single checkbox.The HTML equivalent for this component is
<input type="checkbox">
. The Checkbox component is just the checkbox itself. You have to add a Component Label element to provide a descriptive label for the checkbox.
If you want a set of checkboxes that is preformatted with labels in a group, you can use a Checkbox Group component from the Basic category of the Palette instead.
After dragging the component to the Visual Designer, you can do a number of things with it:
id
attribute. In the page bean, this property's value is the name of the HtmlSelectOneCheckbox
object.true
, the checkbox is rendered as a selected checkbox when it first displays on the user's HTML page.validate
method so you can insert code to validate the value of the component.processValueChange
method so you can insert code that executes when the value of this component changes (for example, the user
changes the value of another component that is controlling
the value of this component).value
property to a data provider or an object so your application can evaluate it when the page is submitted. For more information, see Bind to Data Dialog Box.common_timeoutSubmitForm(this.form, 'component-id');
. At runtime, this code causes the form to be automatically submitted if the user changes the component value. Once the form is submitted, conversion and validation occur on the server and any value change listener methods execute, and then the page is redisplayed.
A component configured to Auto-Submit on Change can use virtual forms to limit the input fields that are processed when the form is submitted. If the auto-submit component is defined to submit a virtual form, only the participants in that virtual form will be processed when the auto-submit occurs.
value
property to other objects or bean properties that update this component's properties automatically.