|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--objectivehtml.oms.OMSObject | +--objectivehtml.htmlwidget.HtmlElement | +--objectivehtml.htmlwidget.HtmlWidget | +--objectivehtml.htmlwidget.HtmlControlWidget | +--objectivehtml.htmlwidget.HtmlInput | +--objectivehtml.htmlwidget.HtmlRadioButton
This class represents a html radio button. i.e.
<input type="radio" ... >
This widget is normally used with a group of radio buttons. The widget allows the user to select one option from a group of options. All radio buttons should have a unique value, otherwise the object will not be able to correctly identify the selected radio button.
Unlike the other control widgets, more than one radio button can have the same control name. When radio buttons have the same control name then they're grouped together. Only one radio button in the same group can ever be selected.
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 | |
HtmlRadioButton(HtmlContainerWidget objParent,
java.lang.String sGroupName)
Constructs an instance of HtmlRadioButton belonging to the radio button group sGroupName. |
Method Summary | |
void |
destroy()
Deletes itself and removes itself from the radio button group. |
HtmlRadioButtonGroup |
getRadioButtonGroup()
Returns a reference to the radio button group managing this radio button. |
boolean |
isChecked()
Returns true if the radio button 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 radio button to be checked/unchecked. |
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, 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 HtmlRadioButton(HtmlContainerWidget objParent, java.lang.String sGroupName) throws InvalidControlNameException, InvalidParentWidgetException, InvalidChildWidgetException
objParent
- the parent of this widgetsName
- the group control name for the objectInvalidControlNameException
- if the control name is not validInvalidParentWidgetException
- if the specified parent widget is not validInvalidChildWidgetException
- if the parent widget does not accept this widget as a childMethod Detail |
public HtmlRadioButtonGroup getRadioButtonGroup()
Returns a reference to the radio button group managing this radio button.
All radio buttons belong to a radio button group. The group a button belongs to is determined by its group name.
public void setChecked(boolean bChecked)
Sets the radio button to be checked/unchecked. If the radio button is checked then all other will be unchecked if the group object has been set to synchronized.
The html attribute it sets is "checked".
If false is specified the attribute is cleared.
bChecked
- true if checked, false otherwisesetBooleanAttribute(String, boolean)
,
isChecked()
,
HtmlRadioButtonGroup.isSynchronized()
public boolean isChecked()
HtmlElement.getBooleanAttribute(String)
,
setChecked(boolean)
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 dataHtmlInput.getValue()
,
HtmlWidget.isVisible()
,
HtmlControlWidget.isDisabled()
,
HtmlControlWidget.isAutoUpdate()
,
HtmlControlWidget.getSubmittedData(HttpServletRequest)
public void destroy()
destroy
in class HtmlControlWidget
objectivehtml.htmlwidget.HtmlWidget
HtmlWidget.isDestroyed()
public Signal selectionChanged(boolean bChecked)
bChecked
- true if the object has been checked, false if uncheckedpublic 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 attributebIsOn
- true if attribute should be set, if false
is specified then the attribute is cleared
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |