Class: InputWidget

XV. InputWidget

Maintains a consistent API to be used by workspaces.
The superkind from which other xTuple input objects are derived.
To create an input field for strings, see XV.InputWidget.
To create an input field for dates, see XV.DateWidget.
To create an input field for files, see XV.FileInput.
To create an input field for numbers, see XV.NumberWidget.
To create a multi-line textarea input box, see XV.TextArea.
To create a checkbox, see XV.CheckboxWidget.
To create a togglebutton, see XV.TogglebuttonWidget.

new InputWidget()

Source:

Methods

clear()

Sets the value of the input to an empty string
Source:

disabledChanged()

The disabledChanged method, and many below it, are here to deal with the fact that XV.Input does not inherit from onyx.input or enyo.input, and so insofar as it needs to support their APIs, we have to redeclare the methods and pass through the data.
Source:

inputChanged()

Called when the user changes the input. Validates field. If valid, calls setValue, which bubbles the event. Otherwise we bubble ourselves the empty string.
Source:

keyDown()

"text-shadow-none" hack here to fix issue #18397
Source:
To Do:
  • Revisit/remove after fix to ENYO-1104. See also issue 18397. Added some handling here to force the input to save the value when the user uses the arrows or tab key.

labelChanged()

Sets the label content based on the label value or the attribute text.
Source:

maxlengthChanged()

Set the maxlength attribute on the input field.
Source:

placeholderChanged()

Sets the placeholder on the input field.
Source:

receiveBlur()

Webkit browsers do not always emit the proper change event, so this ensures that the changed value is saved.
Source:

setValue()

If the value has changed, update the user field using valueChanged, and bubble up the event so that the model may be updated (unless silent is true, which is how the workspace invokes it). This function nicely handles being told what to do both from below, by the user, or from above, by the workspace. The event that it bubbles up is valueChange, whereas the event that probably triggered it is inputChange.
Source:

showLabelChanged()

Sets visibility of the widget label.
Source:

typeChanged()

Sets the type attribute for input field.
Source:

validate()

Returns the value if it's valid, or false if it's not
Source:

valueChanged()

Updates the field that the user sees based on the published field.
Source: