Class HtmlCheckBox


public class HtmlCheckBox
extends HtmlInput

This class represents a html check box. i.e.

<input type="checkbox" ... >

The widget provides the user with 2 options, either on (checked) or off (unchecked). All HtmlCheckBox objects should have a value set for it. If a value is not set then the object will not be able to correctly identify whether the check box is checked or not.

The widget emits these signals:

Fields inherited from class objectivehtml.htmlwidget.HtmlControlWidget
m_bAutoEscape, m_bAutoUpdate
Fields inherited from class objectivehtml.htmlwidget.HtmlWidget
m_bDestroyed, m_bVisible, m_objHtmlForm, m_objParentWidget
Fields inherited from class objectivehtml.htmlwidget.HtmlElement
m_hmAttributes, m_sEndTag, m_sQuoteType, m_sStartTag
Constructor Summary
HtmlCheckBox(HtmlContainerWidget objParent, java.lang.String sName)
          Constructs a new instance of HtmlCheckBox with the specified parent and control name.
Method Summary
 boolean isChecked()
          Returns true if the object is checked, false otherwise.
 Signal selectionChanged(boolean bChecked)
          This signal is emitted when the "checked" attribute of this object is changed.
 void setBooleanAttribute(java.lang.String sAttributeName, boolean bIsOn)
          Sets a boolean-attribute of this object.
 void setChecked(boolean bChecked)
          Sets the object to be checked (if true) or unchecked (if false).
 void updateData(javax.servlet.http.HttpServletRequest objRequest)
          Updates this object with the data submitted from the client.
Methods inherited from class objectivehtml.htmlwidget.HtmlInput
genStartTag, getText, getType, getValue, setAttribute, setText, setType, setValue, valueChanged
Methods inherited from class objectivehtml.htmlwidget.HtmlControlWidget
dataSubmitted, dataSubmitted, destroy, getName, getOnBlur, getOnChange, getOnFocus, getOnSelect, getSubmittedData, getSubmittedDataSet, getTabIndex, getUpdateOrder, isAutoEscape, isAutoUpdate, isDisabled, printHtml, printHtml, setAutoEscape, setAutoUpdate, setDisabled, setOnBlur, setOnChange, setOnFocus, setOnSelect, setTabIndex, setUpdateOrder, setVisible
Methods inherited from class objectivehtml.htmlwidget.HtmlWidget
changeParent, changeParent, getClassAttribute, getHtmlForm, getID, getOnClick, getOnDblClick, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getParent, getStyle, isDestroyed, isVisible, setClassAttribute, setID, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setStyle
Methods inherited from class objectivehtml.htmlwidget.HtmlElement
genEndTag, genStartTag, getAttribute, getAttributes, getBooleanAttribute, getQuoteType, printHtml, printHtml, printHtml, printHtml, printHtml, printHtml, setQuoteType, toString, toString
Methods inherited from class objectivehtml.oms.OMSObject
compareClasses, connect, disconnect, emit, isAlive, setAlive, signal, slot, slot
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public HtmlCheckBox(HtmlContainerWidget objParent,
                    java.lang.String sName)
             throws InvalidControlNameException,
Constructs a new instance of HtmlCheckBox with the specified parent and control name.
objParent - the parent of this widget
sName - the unique control name for the object
InvalidControlNameException - if the control name is not valid
InvalidParentWidgetException - if the specified parent widget is not valid
InvalidChildWidgetException - if the parent widget does not accept this widget as a child
Method Detail


public void setChecked(boolean bChecked)

Sets the object to be checked (if true) or unchecked (if false).

The method will set the "checked" boolean-attribute.

If false is specified the attribute is cleared.

bChecked - true if you want the object checked, false otherwise
See Also:


public boolean isChecked()
Returns true if the object is checked, false otherwise.
true if radio button is checked, false otherwise
See Also:


public void updateData(javax.servlet.http.HttpServletRequest objRequest)

Updates this object with the data submitted from the client. If the submitted data for this object equals the current value for this object then the object will become checked. If no data is submitted or the submitted data does not equal the current value of the object then the object will be unchecked.

The object will only be updated if the auto-update is on and if the object is visible and not disabled.

updateData in class HtmlControlWidget
objRequest - the request object that contains the user submitted data
See Also:
HtmlInput.getValue(), HtmlWidget.isVisible(), HtmlControlWidget.isDisabled(), HtmlControlWidget.isAutoUpdate(), HtmlControlWidget.getSubmittedData(HttpServletRequest)


public void setBooleanAttribute(java.lang.String sAttributeName,
                                boolean bIsOn)
                         throws InvalidAttributeException

Sets a boolean-attribute of this object.

setBooleanAttribute in class HtmlInput
sAttributeName - the name of the attribute
bIsOn - true if attribute should be set, if false is specified then the attribute is cleared


public Signal selectionChanged(boolean bChecked)
This signal is emitted when the "checked" attribute of this object is changed.
bChecked - true if the object has been checked, false if unchecked
the signal