OverviewSingleDeprecated

jsx3.gui

interface Form

jsx3.gui.Form

All Known Implementing Classes:

jsx3.gui.Button, jsx3.gui.CheckBox, jsx3.gui.ColorPicker, jsx3.gui.DatePicker, jsx3.gui.Grid, jsx3.gui.ImageButton, jsx3.gui.List, jsx3.gui.Matrix, jsx3.gui.Menu, jsx3.gui.RadioButton, jsx3.gui.Select, jsx3.gui.Slider, jsx3.gui.Table, jsx3.gui.TextBox, jsx3.gui.TimePicker, jsx3.gui.ToolbarButton, jsx3.gui.Tree

interface Form
Mixin interface. Contains methods and constants encapsulating the functionality of an HTML form control.

Field Summary
static String
DEFAULTDISABLEDBACKGROUNDCOLOR
#d8d8e5 (default)
static String
DEFAULTDISABLEDCOLOR
#a8a8b5 (default)
static int
OPTIONAL
Value for the required field indicating that the form field is optional.
static int
REQUIRED
Value for the required field indicating that the form field is required.
static int
STATEDISABLED
Value for the enabled field indicating that the form field is disabled.
static int
STATEENABLED
Value for the enabled field indicating that the form field is enabled.
static int
STATEINVALID
Value for the validation state field indicating that the value of the form field is invalid.
static int
STATEVALID
Value for the validation state field indicating that the value of the form field is valid.
Method Summary
jsx3.gui.HotKey
doKeyBinding(fctCallback : Function, strKeys : String)
Binds the given key sequence to a callback function.
jsx3.gui.Form
Resets the validation state of this control.
abstract int
Abstract method that must be implemented by any class that implements the Form interface.
String
Returns the background color of this control when it is disabled.
String
Returns the font color to use when this control is disabled.
int
Returns the state for the form field control.
String
Returns the key binding that when keyed will fire the execute event for this control.
int
Returns whether or not this control is required.
int
Returns the validation state of this control.
Number | String
Returns the value of this control.
static String
Deprecated.
static void
reset(objJSXContainer : jsx3.app.Model)
Traverses the DOM branch starting at objJSXContainer and calls doReset() on all nodes of type jsx3.gui.Form.
jsx3.gui.Form
Sets the background color of this form control when it is disabled.
jsx3.gui.Form
setDisabledColor(strColor : String)
Sets the font color to use when this control is disabled.
void
setEnabled(intEnabled : int, bRepaint : boolean)
Sets whether this control is enabled.
jsx3.gui.Form
setKeyBinding(strSequence : String)
Sets the key binding that when keyed will fire the bound execute (jsx3.gui.Interactive.EXECUTE) event for this control.
jsx3.gui.Form
setRequired(required : int)
Sets whether or not this control is required.
jsx3.gui.Form
setValidationState(intState : int)
Sets the validation state of this control.
jsx3.gui.Form
setValue(vntValue : Number | String)
Sets the value of this control.
static int
validate(objJSXContainer : jsx3.app.Model, objHandler : Function)
Traverses the DOM branch starting at objJSXContainer and calls doValidate() on all nodes of type jsx3.gui.Form.
Field Detail

DEFAULTDISABLEDBACKGROUNDCOLOR

static String DEFAULTDISABLEDBACKGROUNDCOLOR
#d8d8e5 (default)

DEFAULTDISABLEDCOLOR

static String DEFAULTDISABLEDCOLOR
#a8a8b5 (default)

OPTIONAL

static final int OPTIONAL
Value for the required field indicating that the form field is optional.

REQUIRED

static final int REQUIRED
Value for the required field indicating that the form field is required.

STATEDISABLED

static final int STATEDISABLED
Value for the enabled field indicating that the form field is disabled.

STATEENABLED

static final int STATEENABLED
Value for the enabled field indicating that the form field is enabled.

STATEINVALID

static final int STATEINVALID
Value for the validation state field indicating that the value of the form field is invalid.

STATEVALID

static final int STATEVALID
Value for the validation state field indicating that the value of the form field is valid.
Method Detail

doKeyBinding

jsx3.gui.HotKey doKeyBinding(fctCallback : Function, strKeys : String)
Binds the given key sequence to a callback function. Any object that has a key binding (specified with setKeyBinding()) will call this method when painted to register the key sequence with an appropriate ancestor of this form control. Any key down event that bubbles up to the ancestor without being intercepted and matches the given key sequence will invoke the given callback function.

As of 3.2: The hot key will be registered with the first ancestor found that is either a jsx3.gui.Window, a jsx3.gui.Dialog, or the root block of a jsx3.app.Server.

Parameters:

fctCallbackJavaScript function to execute when the given sequence is keyed by the user.
strKeysa plus-delimited ('+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc. Any combination of shift, ctrl, and alt are supported, including none. Also supported as the final token are enter, esc, tab, del, and space. To specify the final token as a key code, the last token can be the key code contained in brackets, [13].

Returns:

the registered hot key. 

See Also:

setKeyBinding()

doReset

jsx3.gui.Form doReset()
Resets the validation state of this control.

Returns:

this object.  

doValidate

abstract int doValidate()
Abstract method that must be implemented by any class that implements the Form interface.

Returns:

STATEINVALID or STATEVALID.  

getDisabledBackgroundColor

String getDisabledBackgroundColor()
Returns the background color of this control when it is disabled.

Returns:

valid CSS property value, (i.e., red, #ff0000)  

getDisabledColor

String getDisabledColor()
Returns the font color to use when this control is disabled.

Returns:

valid CSS property value, (i.e., red, #ff0000)  

getEnabled

int getEnabled()
Returns the state for the form field control. If no enabled state is set, this method returns STATEENABLED.

Returns:

STATEDISABLED or STATEENABLED

See Also:

STATEDISABLED, STATEENABLED

getKeyBinding

String getKeyBinding()
Returns the key binding that when keyed will fire the execute event for this control.

Returns:

plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc 

See Also:

doKeyBinding()

getRequired

int getRequired()
Returns whether or not this control is required. If the required property has never been set, this method returns OPTIONAL.

Returns:

REQUIRED or OPTIONAL

See Also:

REQUIRED, OPTIONAL

getValidationState

int getValidationState()
Returns the validation state of this control. If the validationState property has never been set, this method returns STATEVALID.

Returns:

STATEINVALID or STATEVALID

See Also:

STATEINVALID, STATEVALID

getValue

Number | String getValue()
Returns the value of this control.

Returns:

 

getVersion

static String getVersion()
Deprecated.
Returns the release/build for the class (i.e., "2.2.00")

Returns:

 

reset

static void reset(objJSXContainer : jsx3.app.Model)
Traverses the DOM branch starting at objJSXContainer and calls doReset() on all nodes of type jsx3.gui.Form.

Parameters:

objJSXContainerJSX GUI object containing all form fields that need to be reset (the 'reset' process will start with this item and be applied to all descendants, not just direct children)

See Also:

doReset()

setDisabledBackgroundColor

jsx3.gui.Form setDisabledBackgroundColor(strColor : String)
Sets the background color of this form control when it is disabled.

Parameters:

strColorvalid CSS property value, (i.e., red, #ff0000)

Returns:

this object.  

setDisabledColor

jsx3.gui.Form setDisabledColor(strColor : String)
Sets the font color to use when this control is disabled.

Parameters:

strColorvalid CSS property value, (i.e., red, #ff0000)

Returns:

this object.  

setEnabled

void setEnabled(intEnabled : int, bRepaint : boolean)
Sets whether this control is enabled. Disabled controls do not respond to user interaction.

Parameters:

intEnabledSTATEDISABLED or STATEENABLED. null is equivalent to STATEENABLED.
bRepaintif true this control is immediately repainted to reflect the new setting.

setKeyBinding

jsx3.gui.Form setKeyBinding(strSequence : String)
Sets the key binding that when keyed will fire the bound execute (jsx3.gui.Interactive.EXECUTE) event for this control.

Parameters:

strSequenceplus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc

Returns:

this object. 

See Also:

doKeyBinding()

setRequired

jsx3.gui.Form setRequired(required : int)
Sets whether or not this control is required.

Parameters:

required{int} REQUIRED or OPTIONAL.

Returns:

this object.  

setValidationState

jsx3.gui.Form setValidationState(intState : int)
Sets the validation state of this control. The validation state of a control is not serialized.

Parameters:

intStateSTATEINVALID or STATEVALID.

Returns:

this object.  

setValue

jsx3.gui.Form setValue(vntValue : Number | String)
Sets the value of this control.

Parameters:

vntValuestring/int value for the component

Returns:

this object.  

validate

static int validate(objJSXContainer : jsx3.app.Model, objHandler : Function)
Traverses the DOM branch starting at objJSXContainer and calls doValidate() on all nodes of type jsx3.gui.Form. A custom function handler, objHandler, can be passed that will be called once for each encountered form control.

Parameters:

objJSXContainerJSX GUI object containing all form fields that need to be validated (recursive validation will start with this item and be applied to all descendants, not just direct children)
objHandlera JavaScript function (as object). This function will be passed two parameters: the object reference to the JSX Form object (textbox, selectbox, checkbox, etc) being validated as well as a constant denoting whether or not it validated (0 or 1)—1 meaning true

Returns:

STATEINVALID or STATEVALID.