Class M.TextFieldView
Extends
M.View.
M.TextFieldView is the prototype of any text field input view. It can be rendered as both
a single line text field and a multiple line text field. If it is styled as a multiple
line text field, is has a built-in autogrow mechanism so the textfield is getting larger
depending on the number of lines of text a user enters.
Defined in: text_field.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
Defines whether the text field has multiple lines respectively is a text area.
|
|
The initial text shown inside the text field describing the input or making a suggestion for input
e.g.
|
|
Defines whether the text field is rendered as an password field or not.
|
|
The label proeprty defines a text that is shown above or next to the textfield as a 'title'
for the textfield.
|
|
The name of the text field.
|
|
The type of this object.
|
- Fields borrowed from class M.View:
- childViews, contentBinding, cssClass, cssClassOnError, cssClassOnInit, cssStyle, hasFocus, html, id, isInline, isView, modelId, parentView, triggerActionOnChange, triggerActionOnEnter, triggerActionOnKeyUp, value
Method Attributes | Method Name and Description |
---|---|
disable()
This method disables the text field by setting the disabled property of its
html representation to true.
|
|
enable()
This method enables the text field by setting the disabled property of its
html representation to false.
|
|
gotFocus()
This method is called whenever the view gets the focus.
|
|
This method is called whenever the view lost the focus.
|
|
setValue(value, delegateUpdate)
This method sets the text field's value, initiates its re-rendering
and call the delegateValueUpdate().
|
|
setValueFromDOM(evt)
This method sets its value to the value it has in its DOM representation
and then delegates these changes to a controller property if the
contentBindingReverse property is set.
|
- Methods borrowed from class M.View:
- addCssClass, attachToObservable, clearHtml, computeValue, contentDidChange, delegateValueUpdate, design, nl2br, removeCssClass, removeCssProperty, renderUpdate, secure, setCssProperty, style, theme, themeChildViews
- Methods borrowed from class M.Object:
- bindToCaller, create, destroy, extend, get, include, set
Field Detail
{Boolean}
hasMultipleLines
Defines whether the text field has multiple lines respectively is a text area.
{String}
initialText
The initial text shown inside the text field describing the input or making a suggestion for input
e.g. "Please enter your Name."
{Boolean}
isPassword
Defines whether the text field is rendered as an password field or not.
{String}
label
The label proeprty defines a text that is shown above or next to the textfield as a 'title'
for the textfield. e.g. "Name:". If no label is specified, no label will be displayed.
{String}
name
The name of the text field. During the rendering, this property gets assigned to the name
property of the text field's html representation. This can be used to manually access the
text field's DOM representation later on.
{String}
type
The type of this object.
Method Detail
disable()
This method disables the text field by setting the disabled property of its
html representation to true.
enable()
This method enables the text field by setting the disabled property of its
html representation to false.
gotFocus()
This method is called whenever the view gets the focus.
If there is a initial text specified and the value of this text field
still equals this initial text, the value is emptied.
lostFocus()
This method is called whenever the view lost the focus.
If there is a initial text specified and the value of this text field
is empty, the value is set to the initial text.
setValue(value, delegateUpdate)
This method sets the text field's value, initiates its re-rendering
and call the delegateValueUpdate().
- Parameters:
- {String} value
- The value to be applied to the text field view.
- {Boolean} delegateUpdate
- Determines whether to delegate this value update to any observer or not.
setValueFromDOM(evt)
This method sets its value to the value it has in its DOM representation
and then delegates these changes to a controller property if the
contentBindingReverse property is set.
Additionally call target / action if set.
- Parameters:
- {Object} evt
- The event triggered this method.