Upload

(esrith/amos/form/Upload)

Control for uploading file to server. This control can restrict file size and type to upload to the server. On form submission, the uploaded file is attached along but it is only saved temporarily to the server's temporary folder until the server is ordered to save it permanently at a specified directory.

Description
new Upload(params?srcNodeRef?)

Create a new Upload widget.

Type Description
_styleAttr Object

when you want to set style for other node. you can do this by example... _styleAttr:{ style-property:effected-node } this property was effected where this class was inherited and your widget was called by... var widget = new YourWidget({ style:{ style-property:style-value } }); now effected-node in you widget will have style-property = style-value

_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.

btnUpload UploadButton | UploadImageButton

upload button

busy Boolean

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

buttonLabel String

Text that appears on button.

customIcons DOMNode | String[] | Object[]

Add custom icons and their functionalities. This property can receive an array of DOM nodes of HTML markups or DOM nodes created from a widget creation. It allows an array of image path strings and CSS class strings. It also accepts an array consisting both types of inputs.

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.

errorMessageVisible Boolean

If true, error message is visible when an error occur. Otherwise, nothing is shown when an error occrus.

errorType String

Error type of text box (use constant.)

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.

hasClearIcon Boolean

If true, a clear icon is shown near right border inside the text box once there is at least a character input.

id String

An unique id for a text box. (The specified value must be unique within the document.)

intermediateChanges Boolean

IntermediateChanges is a boolean property that fires the onChange event whenever the value of the TextBox or other form changes if intermediateChanges is true.

label String

Label of a text box.

leftIcons DOMNode | String[] | Object[]

Add custom icons and their functionalities at the left of textbox. This property can receive an array of DOM nodes of HTML markups or DOM nodes created from a widget creation. It allows an array of image path strings and CSS class strings. It also accepts an array consisting both types of inputs.

maxLength Number

Maximum number of characters that can be entered.

name String

Name of upload control. When use a control for request to server, this property is parameter's name.

placeHolder String

Placeholder is a short hint that describes expected value of an input field. It is displayed in the input field before the user enters a value.

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.

regExp RegExp

Disabled property.

required Boolean

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

rightIcons DOMNode | String[] | Object[]

Add custom icons and their functionalities at the right of textbox. This property can receive an array of DOM nodes of HTML markups or DOM nodes created from a widget creation. It allows an array of image path strings and CSS class strings. It also accepts an array consisting both types of inputs.

textAlign String

Specify the alignment of value in text box.

trim Boolean

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

type String

Specify the type of value in text box to display.

valid Boolean

If valid is true, check the validity of upload file.

validSize Number

Maximum allowed size for uploaded files. Default is ‘0’, which means infinite size.

validType String[]

Type of file for upload.

value File

Value of a upload control.

viewMode Boolean

If true, the control will show only the displayedValue.

width Number | String

Width of text box.

Return type Description
__baseClassInherit(constructor) None

get className from superclass.

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 text validation succeeded; otherwise, false.

isVisible(elem?) Boolean

Return true if the element is visible, otherwise false.

reset() None

Use the reset() method to reset all state and value to default.

show(elem?) None

Display a specified element.

showError(msgError) None

Show error message.

toggle(elem?) None

Toggle visibility of a specified element.

Description
blur

Fires when an object loses focus.

change

The event fires when the value of an element has been changed.

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.

icon-clear-click

Fires when user clicks icon for clear text in a text box. (Icon that appears on the rigth of text box.)

icon-click

Fires when user clicks icon (custom icon).

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.

Constructors Detail
new Upload(params?srcNodeRef?)

Inherited from TextBox but overwritten in esrith/amos/form/Upload.js:24

Create a new Upload widget.

Parameters:
Properties Detail
<Object>
_styleAttr

when you want to set style for other node. you can do this by example... _styleAttr:{ style-property:effected-node } this property was effected where this class was inherited and your widget was called by... var widget = new YourWidget({ style:{ style-property:style-value } }); now effected-node in you widget will have style-property = style-value

Default value: {}

<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

<UploadButton | UploadImageButton>
btnUpload

upload button

<Boolean>
busy

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

Default value: false

<String>
buttonLabel

Text that appears on button.

Default value: "Browse..."

<DOMNode | String[] | Object[]>
customIcons
deprecated

Inherited from: esrith/amos/form/TextBox.js:247

Deprecated: Use leftIcons and/or rightIcons instead

Add custom icons and their functionalities. This property can receive an array of DOM nodes of HTML markups or DOM nodes created from a widget creation. It allows an array of image path strings and CSS class strings. It also accepts an array consisting both types of inputs.

<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>
errorMessageVisible

If true, error message is visible when an error occur. Otherwise, nothing is shown when an error occrus.

Default value: true

<String>
errorType

Error type of text box (use constant.)

Default value: ERROR_INVALID

<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>
hasClearIcon

If true, a clear icon is shown near right border inside the text box once there is at least a character input.

Default value: true

<String>
id

An unique id for a text box. (The specified value must be unique within the document.)

<Boolean>
intermediateChanges

Inherited from _TextBoxBase but overwritten in esrith/amos/form/Upload.js:158

IntermediateChanges is a boolean property that fires the onChange event whenever the value of the TextBox or other form changes if intermediateChanges is true.

Default value: false

<String>
label

Inherited from _FormMixin but overwritten in esrith/amos/form/TextBox.js:630

Label of a text box.

<DOMNode | String[] | Object[]>
leftIcons

Add custom icons and their functionalities at the left of textbox. This property can receive an array of DOM nodes of HTML markups or DOM nodes created from a widget creation. It allows an array of image path strings and CSS class strings. It also accepts an array consisting both types of inputs.

<Number>
maxLength

Maximum number of characters that can be entered.

Default value: 0

<String>
name

Inherited from _FormConstruct but overwritten in esrith/amos/form/Upload.js:141

Name of upload control. When use a control for request to server, this property is parameter's name.

<String>
placeHolder

Placeholder is a short hint that describes expected value of an input field. It is displayed in the input field before the user enters a value.

<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

<RegExp>
regExp

Inherited from TextBox but overwritten in esrith/amos/form/Upload.js:231

Disabled property.

<Boolean>
required

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

Default value: false

<DOMNode | String[] | Object[]>
rightIcons

Add custom icons and their functionalities at the right of textbox. This property can receive an array of DOM nodes of HTML markups or DOM nodes created from a widget creation. It allows an array of image path strings and CSS class strings. It also accepts an array consisting both types of inputs.

<String>
textAlign

Specify the alignment of value in text box.

Default value: left

<Boolean>
trim

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

Default value: true

<String>
type

Specify the type of value in text box to display.

Default value: text

<Boolean>
valid

Inherited from _FormConstruct but overwritten in esrith/amos/form/Upload.js:101

If valid is true, check the validity of upload file.

<Number>
validSize

Maximum allowed size for uploaded files. Default is ‘0’, which means infinite size.

Default value: 0

<String[]>
validType

Type of file for upload.

<File>
value

Inherited from _FormConstruct but overwritten in esrith/amos/form/Upload.js:267

Value of a upload control.

<Boolean>
viewMode

If true, the control will show only the displayedValue.

Default value: false

<Number | String>
width

Width of text box.

Default value: 200

Methods Detail
__baseClassInherit
(
  • constructor
)

get className from superclass.

Parameters
  • <Object> constructor Required
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
()

Inherited from _FormConstruct but overwritten in esrith/amos/form/TextBox.js:537

Returns true when text 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
()

Inherited from _FormConstruct but overwritten in esrith/amos/form/Upload.js:194

Use the reset() method to reset all state and value to default.

show
(
  • elem?
)

Display a specified element.

Parameters
  • <Node> elem Optional

    Specified element to be displayed.

showError
(
  • msgError
)

Show error message.

Parameters
  • <String> msgError Required

    Text for error message.

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

change

The event fires when the value of an element has been changed.

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

icon-clear-click

Fires when user clicks icon for clear text in a text box. (Icon that appears on the rigth of text box.)

Event Payload:
  • <Object> evt

    -javascript event object

icon-click

Fires when user clicks icon (custom icon).

Event Payload:
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