|
CAF Shared JavaScript | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--CAF.Output.Model | +--CAF.Input.Model
CAF Input client-side model.
Defined in core.js
Field Summary | |
Object |
classes
|
Fields inherited from class CAF.Output.Model |
id, form
|
Constructor Summary | |
CAF.Input.Model
()
|
Method Summary | |
void
|
addValidator(validator)
Adds a validator. |
void
|
addValueChangeListener(fn, ignoreWhenDisabled, key)
Adds value-change listener. |
Object
|
getLabel()
Gets input's label HTML (if input has label). |
Object
|
getValue()
Gets this control's string or string array value. |
Object
|
isEmpty()
Returns true if a value hasn't been entered for this control (ie should fail "required" validation). |
Object
|
isFocused()
Returns true if this control is focused. |
Object
|
listValidators()
Lists registered validators. |
Object
|
listValueChangeListeners()
Lists registered value-change listeners. |
void
|
removeValidator(validator)
Removes a validator. |
void
|
removeValueChangeListener(fn)
Removes value-change listener. |
Object
|
setDisabled(disabled)
Sets this control as disabled or enabled. |
Object
|
setFocused(focus)
Sets this control as focused or not focused. |
void
|
setLabel(label)
Sets input's label HTML (if input has label). |
void
|
setValue(value)
Sets this control's string or string array value. |
Object
|
validate(setfocus)
Re-validates this input control. |
Field Detail |
Object classes
Constructor Detail |
CAF.Input.Model()
Method Detail |
void addValidator(validator)
validator
- Validator function.
void addValueChangeListener(fn, ignoreWhenDisabled, key)
fn
- Value-change listener.
ignoreWhenDisabled
- True to ignore value-changes when control is disabled.
Object getLabel()
Object getValue()
Object isEmpty()
Object isFocused()
Object listValidators()
Object listValueChangeListeners()
void removeValidator(validator)
validator
- Validator function.
void removeValueChangeListener(fn)
fn
- Value-change listener.
Object setDisabled(disabled)
Object setFocused(focus)
void setLabel(label)
Un
- -escaped input label.
void setValue(value)
value
- String value, or in the case of a control with multiple values, an array of string values. If the control has no value, pass an empty string ("") or an empty arry ([]); never null.
Object validate(setfocus)
setfocus
- (optional) True to set focus to control if invalid.
|
CAF Shared JavaScript | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |