Class OptionBox
Object
|
+--MoreMotionObject
|
+--ProcessField
|
+--OptionBox
- class
OptionBox
- extends ProcessField
This class wraps a container element that includes two or more HTML Input ("radio") Elements
and manages it as an input field. The container element can be any HTML DOM element that can contain
form input elements. i.e. DIV
or TABLE
<div
mo:type="OptionBox" mo:field="true" mo:name="GENDER" mo:needsInit="true"
mo:props="nonBlank:true, warnColor:'Red'" class="c3" mo:iValue="F" >
<input type="radio" value="M" onclick="PMgr.selectOption(this)" name="_x"/>
<input type="radio" value="F" onclick="PMgr.selectOption(this)" name="_x"/>
<input type="hidden" name="pf_GENDER">
</div>
The container element should contain a INPUT type="hidden"
element
whose name attribute has a prefix "pf_"
to indicate that it is a Process Field.
The values of the name attributes of the INPUT type="radio"
elements must be identical so that
they act as a group.
Defined in OptionBox.js
Field Summary |
boolean |
isOptionBox
|
Array |
options
Array that keeps the references to the wrapped HTML Input ("radio") Elements |
HTMLElement |
selm
The HTMLElement object of HIDDEN TEXT element that keeps the
value to submit to the server. |
Method Summary |
void
|
base(node)
|
void
|
clear()
Clears the checked option and sets the value to blank
|
String
|
getValue()
Returns the value of this field object
|
void
|
init()
|
void
|
selectOption()
Sets the value of this field object to the value of the selected radio button.
|
void
|
setRecordNumber(recnum)
|
void
|
setValue(value)
Sets the value of this field object and checks the
radio button whose value is equal to the specified value.
|
Object
|
validate()
Validates this field object
|
Methods inherited from class ProcessField |
setModified, isModified, getRecord, setSubmitPrefix, appendRequestParams, focusTab, notify, runValidationHandler, checkValueIsAvailable, checkValueIsNumber, checkHasValidValue, runHandler
|
isOptionBox
boolean isOptionBox
options
Array options
Array that keeps the references to the wrapped HTML Input ("radio") Elements
selm
HTMLElement selm
The HTMLElement object of HIDDEN TEXT
element that keeps the
value to submit to the server.
OptionBox
OptionBox(node)
base
void base(node)
Parameters:
node
- the DOM Element node that is wrapped by this field
clear
void clear()
Clears the checked option and sets the value to blank
getValue
String getValue()
Returns the value of this field object
init
void init()
selectOption
void selectOption()
Sets the value of this field object to the value of the selected radio button.
This method should be called by the onclick event procedures of all the radio button elements.
setRecordNumber
void setRecordNumber(recnum)
setValue
void setValue(value)
Sets the value of this field object and checks the
radio button whose value is equal to the specified value.
Parameters:
value
- The value to set. It must be equal to the value of one of the radio buttons wrapped by this field object.
validate
Object validate()
Validates this field object
Copyright 2002 - 2008, MOR YAZILIM
Documentation generated by
JSDoc on Mon Sep 29 14:52:55 2008