Class jabberwerx.ui.TextInput
Extends
jabberwerx.ui.JWView.
A TextInput widget is a GUI mechanism to capture input from the user and allow the containing View to do the appropriate action with it.
This class provides the following events:
Constructor Attributes | Constructor Name and Description |
---|---|
Creates a new TextInput. |
Field Attributes | Field Name and Description |
---|---|
The amount of time left before the chatState changes to Idle. |
- Fields borrowed from class jabberwerx.ui.JWView:
- jq
Method Attributes | Method Name and Description |
---|---|
createDOM(doc)
Creates the DOM for the TextInput widget which consists of a text input field and a button. |
|
Clears out all of the objects created by createDOM. |
|
height(h, noupdate)
Retrieves or changes the height of this view. |
|
restoreDOM(doc)
Restores the DOM for the TextInput widget. |
|
text(val)
Gets or sets the text in the text input field. |
|
update()
This adjusts the size of the widget to display correctly. |
|
width(w, noupdate)
Retrieves or changes the width of this view. |
|
- Methods borrowed from class jabberwerx.ui.JWView:
- destroy, dimensions, hide, parent, persistOptions, remove, render, restoreRender, restoreUpdate, shouldBeSavedWithGraph, show, wasUnserialized
- Methods borrowed from class jabberwerx.JWModel:
- applyEvent, event
- Methods borrowed from class jabberwerx.JWBase:
- getClassName, graphUnserialized, init, invocation, shouldBeSerializedInline, toString
The amount of time left before the chatState changes to Idle.
Creates the DOM for the TextInput widget which consists of a text input field and a button.
- Parameters:
- {Document} doc
- The document to use for creating content.
- Returns:
- {jQuery} The element containing the widget.
Clears out all of the objects created by createDOM.
Retrieves or changes the height of this view.
If {h} is not defined, this method returns the current height of this view, in pixels. Otherwise the height is changed to the value of {h} in pixels (if a Number) or the CSS value (if a String), #update is called (unless {noupdate} is true), and this jabberwerx.ui.JWView is returned.
If this view is not currently rendered, this method returns 0 for retrieval, and ignores {h} for changes.
- Parameters:
- {Number|String} h Optional
- The new height (or undefined to retrieve the current height)
- {Boolean} noupdate Optional
- true if the view should NOT be updated
- Returns:
- {Number|jabberwerx.ui.JWView} The current height (if retrieving); or this jabberwerx.ui.JWView (if changing)
Restores the DOM for the TextInput widget.
- Parameters:
- {Document} doc
- The document to use for creating content.
- Returns:
- {jQuery} The element containing the widget.
Gets or sets the text in the text input field.
If {val} is not defined, this method returns the current text in the text input field. Otherwise the text is changed to the value of {val}.
- Parameters:
- {String} val Optional
- The new text to be put in the text input field.
- Returns:
- {String|jabberwerx.ui.JWView} The current text in the text input field or this jabberwerx.ui.JWView if the text is being set.
This adjusts the size of the widget to display correctly.
Retrieves or changes the width of this view.
If {w} is not defined, this method returns the current width of this view, in pixels. Otherwise the width is changed to the value of {w} in pixels (if a Number) or the CSS value (if a String), #update is called (unless {noupdate} is true), and this jabberwerx.ui.JWView is returned.
If this view is not currently rendered, this method returns 0 for retrieval, and ignores {w} for changes.
- Parameters:
- {Number|String} w Optional
- The new width (or undefined to retrieve the current width)
- {Boolean} noupdate Optional
- true if the view should NOT be updated
- Returns:
- {Number|jabberwerx.ui.JWView} The current width (if retrieving); or this jabberwerx.ui.JWView (if changing)