Control API for Checkbox (checkBox)

A control, consisting of a graphic and associated text, that a user clicks to select or deselect an option. A check mark in the checkBox graphic indicates that the option is selected.

  • checked
    A boolean value that that indicates if a checkBox is selected. "True" shows a check mark in a checkBox and indicates that the checkBox is selected, "false" leaves the checkBox empty and indicates that the checkBox is not selected.
  • disabled
    A boolean value that defines if the checkBox is clickable. If the checkBox is disabled it is not selectable. A disabled checkBox has a different background color for the checkBox graphic and if the checkBox is checked the a different color for the check mark.
  • encode
    A boolean value that defines how the checkBox text is interpreted. HTML text formatting commands (e.g. <h1>, <i> etc.) can be used to change the display of the checkBox text. If there are no formatting commands in the checkBox text string, the encode attribute has no effect.

    Example

    text="<h1><i>Important</i></h>"

    encode = "false"
    the text string is rendered by interpreting the formatting commands.

    Encode = "true"
    the formatting commands are displayed and not interpreted

  • id
    Identification name of the checkBox.
  • key
    A string which is assigned to the checkbox when the form is sent to the server. A key string has be defined and must not be empty.
  • onClick
    Defines the action that will be processed when the user clicks on the enabled checkBox. If you do not define a 'onClick' Event the checkBox can be clicked but no event is generated.
  • text
    Defines the string of text placed right of the check box graphic. If no text should be displayed an empty string (null) can be used. See 'encode' for a formatting example with embedded HTML commands.
  • tooltip
    Defines the hint of the checkBox which is displayed as the mouse cursor passes over the checkBox, or as the mouse button is pressed but not released.
attribute req. values default case sens. JSP taglib classlib
checked no TRUE
FALSE
FALSE yes checked="TRUE" setChecked(true)
disabled no TRUE
FALSE
FALSE yes disabled="TRUE" setDisabled(true)
encode no TRUE
FALSE
TRUE yes encode="FALSE" setEncode(false)
id yes String none yes id="CheckCPU"  
key yes String none no key="chk_k1" setKey("chk_k1")
text no String none no text="CPU status" setText("CPU status")
tooltip no String none no tooltip="Check CPU status" setTooltip("Check CPU status")

 

events req. values default case sens. JSP taglib classlib
onClick no String none yes onClick="process_checkbox" setOnClick("process_checkbox")

 

Example
<hbj:checkbox
          id="CheckCPU"
          text="CPU status"
          key="chk_k1"
          tooltip="Check CPU status"
          disabled="false"
          checked="true"
 />

Result