_TextBoxBase

(esrith/amos/core/_TextBoxBase)

Basic Class for texboxes.

Type Description
_timerChanged dojox.timing.Timer

Timer for 'delayChanged' property.

active Boolean

If true, this forces the control to enter the active state and classname 'amos-form-active' will be added.

busy Boolean

If true, this forces the control to enter the busy state and classname 'amos-form-busy' will be added.

delayChanged Number

Number of milliseconds to wait until timing out before executes a function. Value ‘0’ means no timeout.

disabled Boolean

If true, any control's events(except change) are not responding. Its content cannot be edited and is excluded when the form is submitted.

displayedValue String

The value presently displays in the text box.

error Boolean

If true, this forces the control to enter the error state and classname 'amos-form-error' will be added.

filled Boolean

A flag that shows whether a form element is filled in (true) or empty (false).

focused Boolean

If true, the element is focused.

intermediateChanges Boolean

If true, it will fires onChange event every change to the value of the text box.
Otherwise, it will fire when the text box loses focus after its value was changed.

label String

Label of an element.

maxLength Number

Maximum number of characters that can be entered.

name String

Name of control. When sending a request to server, this property is the parameter's name.

preventInjection Boolean

If true, prevent HTML injection. If false, allow HTML injection. If null, the control will refer to the web configuration file whether to prevent or allow HTML injection.

readOnly Boolean

If true, the control is read-only and cannot be edited. However, its content, if presents, is included in form submission.

required Boolean

If true, the input field must be filled out before form submission.

trim Boolean

If true, blank spaces will be removed from both sides of a string.

valid Boolean

Validity flag that shows whether a form element is validated to be valid (true) or invalid (false).

value String | Number | Object

Value of the element.

viewMode Boolean

If true, the control will show only the displayedValue.

Return type Description
blur() None

Remove focus from an element. (Blur the element.)

focus() None

Focus to an element.

hide(elem?) None

Hide a specified element. The hidden element will not be displayed at all.

isValid() Boolean

Returns true when value validation succeeded; otherwise, false.

isVisible(elem?) Boolean

Return true if the element is visible, otherwise false.

reset() None

Reset all state and value to default.

show(elem?) None

Display a specified element.

toggle(elem?) None

Toggle visibility of a specified element.

Description
blur

Fires when an object loses focus.

click

Fires when the user clicks on an element.

dblclick

Fires when the user double-clicks on an element

focus

Fires when an element gets focus.

keydown

Fires when the user is pressing a key (on the keyboard).

keypress

Fires when the user presses a key (on the keyboard).

keyup

Fires when the user releases a key (on the keyboard).

mousedown

Fires when a user presses a mouse button over an element.

mouseout

Fires when the mouse pointer is moved out of an element.

mouseover

Fires when the mouse pointer is moved onto an element.

mouseup

Fires when a user releases a mouse button over an element.

paste

Fires when the user pastes some content in an element.

Properties Detail
<dojox.timing.Timer>
_timerChanged

Timer for 'delayChanged' property.

<Boolean>
active

If true, this forces the control to enter the active state and classname 'amos-form-active' will be added.

Default value: false

<Boolean>
busy

If true, this forces the control to enter the busy state and classname 'amos-form-busy' will be added.

Default value: false

<Number>
delayChanged

Number of milliseconds to wait until timing out before executes a function. Value ‘0’ means no timeout.

Default value: 0

<Boolean>
disabled

If true, any control's events(except change) are not responding. Its content cannot be edited and is excluded when the form is submitted.

Default value: false

<String>
displayedValue

The value presently displays in the text box.

<Boolean>
error

If true, this forces the control to enter the error state and classname 'amos-form-error' will be added.

Default value: false

<Boolean>
filled

A flag that shows whether a form element is filled in (true) or empty (false).

Default value: false

<Boolean>
focused

If true, the element is focused.

Default value: false

<Boolean>
intermediateChanges

If true, it will fires onChange event every change to the value of the text box.
Otherwise, it will fire when the text box loses focus after its value was changed.

Default value: true

<String>
label

Label of an element.

<Number>
maxLength

Maximum number of characters that can be entered.

Default value: 0

<String>
name

Name of control. When sending a request to server, this property is the parameter's name.

<Boolean>
preventInjection

If true, prevent HTML injection. If false, allow HTML injection. If null, the control will refer to the web configuration file whether to prevent or allow HTML injection.

Default value: false

<Boolean>
readOnly

If true, the control is read-only and cannot be edited. However, its content, if presents, is included in form submission.

Default value: false

<Boolean>
required

If true, the input field must be filled out before form submission.

Default value: false

<Boolean>
trim

If true, blank spaces will be removed from both sides of a string.

Default value: true

<Boolean>
valid

Validity flag that shows whether a form element is validated to be valid (true) or invalid (false).

Default value: true

<String | Number | Object>
value

Value of the element.

<Boolean>
viewMode

If true, the control will show only the displayedValue.

Default value: false

Methods Detail
blur
()

Remove focus from an element. (Blur the element.)

focus
()

Focus to an element.

hide
(
  • elem?
)

Hide a specified element. The hidden element will not be displayed at all.

Parameters
  • <Node> elem Optional

    Specified element to be hidden.

<Boolean>
isValid
()

Returns true when value validation succeeded; otherwise, false.

<Boolean>
isVisible
(
  • elem?
)

Return true if the element is visible, otherwise false.

Parameters
  • <Node> elem Optional

    Specified element to be checked. If not specified, domNode of the widget is used instead.

reset
()

Reset all state and value to default.

show
(
  • elem?
)

Display a specified element.

Parameters
  • <Node> elem Optional

    Specified element to be displayed.

toggle
(
  • elem?
)

Toggle visibility of a specified element.

Parameters
  • <Node> elem Optional

    Specified element to toggle visibility.

Events Detail
blur

Fires when an object loses focus.

Event Payload:
  • <Object> evt

    javascript event object

click

Fires when the user clicks on an element.

Event Payload:
  • <Object> evt

    javascript event object

dblclick

Fires when the user double-clicks on an element

Event Payload:
  • <Object> evt

    javascript event object

focus

Fires when an element gets focus.

Event Payload:
  • <Object> evt

    javascript event object

keydown

Fires when the user is pressing a key (on the keyboard).

Event Payload:
  • <Object> evt

    javascript event object

keypress

Fires when the user presses a key (on the keyboard).

Event Payload:
  • <Object> evt

    javascript event object

keyup

Fires when the user releases a key (on the keyboard).

Event Payload:
  • <Object> evt

    javascript event object

mousedown

Fires when a user presses a mouse button over an element.

Event Payload:
  • <Object> evt

    javascript event object

mouseout

Fires when the mouse pointer is moved out of an element.

Event Payload:
  • <Object> evt

    javascript event object

mouseover

Fires when the mouse pointer is moved onto an element.

Event Payload:
  • <Object> evt

    javascript event object

mouseup

Fires when a user releases a mouse button over an element.

Event Payload:
  • <Object> evt

    javascript event object

paste

Fires when the user pastes some content in an element.

Event Payload:
  • <Object> evt

    javascript event object