SelectBooleanCheckbox |
||||||||||||||||||||||||||
Developer’s Guide Home
Installation and Configuration Common Concepts Components Index Border Layout Panel Calendar Chart Command Button Command Link Composite Filter Confirmation Data Table Date Chooser Day Table Drop Down Field Dynamic Image Folding Panel For Each Graphic Text Hint Label Input Text Input Textarea Layered Pane Level Indicator Popup Layer Popup Menu Select Boolean Checkbox Select Many Checkbox Select One Radio Spinner Suggestion Field Tabbed Pane Tab Set Tree Table Two List Selection Window Focus Load Bundle Scroll Position Ajax Framework Validation Framework Tag Reference API Reference |
Key Features
Basic ConfigurationThe SelectBooleanCheckbox component can be added to a page using the <o:selectBooleanCheckbox> tag. This tag is just an extended version of the standard <h:selectBooleanCheckbox> tag. Therefore, you can safely replace the standard SelectBooleanCheckbox components with OpenFaces SelectBooleanCheckbox components which gives you an additional functionality. Similar to the standard <h:selectBooleanCheckbox> you can use the value attribute to specify the current state of the checkbox and use <h:outputLabel> tag to show a label for the checkbox. Here's an example that shows a definition of a simple SelectBooleanCheckbox with a label and its value attribute bound to a backing bean. <o:selectBooleanCheckbox id="rememberMe" value="#{CheckboxBean.rememberMe}" /> <h:outputLabel for="rememberMe" value="Remember me"/> Tri-State ModeThe SelectBooleanCheckbox supports the tri-state mode where a third "undefined" state is added to the standard "selected" and "unselected" states. This mode can be turned on by specifying the triSateAllowed attribute with a value of true. In case of the third "undefined" state the property bound to the value attribute receives the null value to indicate this state. By default the user is allowed to cycle only through "selected" and "unselected" states. <o:selectBooleanCheckbox triStateAllowed="true" stateList="undefined selected" value="false"/> <o:selectBooleanCheckbox triStateAllowed="true" stateList="#{CheckboxTest.states}" values="#{CheckboxTest.state}"/> Customizing Checkbox Style And ImagesIt's possible to apply a style and rollover style for the checkbox using the style/styleClass and rolloverStyle/rolloverClass attributes. In addition, there are the following attributes that are applied for selected, unselected and undefined checkbox: selectedStyle/selectedClass, unselectedStyle/unselectedClass, undefinedStyle/undefinedClass. By default, the <o:selectBooleanCheckbox> displays the native client operating system checkboxes just like the standard <h:selectBooleanCheckbox> component. Though the <o:selectBooleanCheckbox> component allows overriding the default checkbox appearance with images corresponding to all checkbox's states so it's possible to apply an arbitrary design to the component. The minimum set of attributes that should be defined for changing the look of SelectBooleanCheckbox are the selectedImageUrl, unselectedImageUrl, and optionally the undefinedImageUrl in case of tri-state mode. Though it's also possible to change some apearance aspects in component's rollover, pressed and disabled states, which is possible using the following attributes:
Client-Side APIAll client-side API methods for the SelectBooleanCheckbox component are listed in the following table:
|
|||||||||||||||||||||||||
© 2010 TeamDev Ltd. | ![]() |