Animating Textbox
Overview
The Animating Textbox component is a utility component that takes users' inputs. The Animating TextBox component provides methods to set the various properties of an input box such as text, placeholder, enable masking, restrict characters, and actions to be performed when the input is entered or cleared.
NOTE: The Animating Textbox Component is used inside the Mobile Banking application.
Animating Textbox Contracts
The Animating Textbox component contains the following contracts.
- setData Method
- setReadOnly Method
- setReadWrite Method
- clearText Method
- setText Method
- setErrorText Method
- hideError Method
- getData Method
- getText Method
- onBeginEditingCallback Event
- onEndEditingCallback Event
- onDoneCallback Event
- onTextChangeCallback Event
- onClearCallback Event
setData Method
This method sets the properties of the input box in the Animating Textbox component.
| Parameter | Value |
|---|---|
|
Syntax |
|
| Input parameter |
|
|
Sample Input |
var data = {
"isMasked": false,
"currencySymbol": "$"
"amountPlaceholder": "0.00"
"keyBoardStyle": constants.TEXTBOX_KEY_BOARD_STYLE_DEFAULT,
"isCurrency": true,
"placeholder": "Amount",
"maxTextLength": 19,
"restrictCharactersSet": "~#^|$%&*!",
"text": "123.00",
"textInputMode": constants.TEXTBOX_INPUT_MODE_ANY,
"keyboardActionLabel": TEXTBOX_KEYBOARD_LABEL_DONE,
"errorText": "",
"onBeginEditingCallback": this.formFunc1,
"onEndEditingCallback": this.formFunc2,
"onDoneCallback": this.formFunc3,
"onTextChangeCallback": this.formFunc4,
"onClearCallback": this.formFunc5,
"isReadOnly": false
};
this.view.animatingtextbox.setData(data);
|
|
Return Type |
None |
setReadOnly Method
This method is used to set the component in a read-only mode.
| Parameter | Value |
|---|---|
|
Syntax |
|
| Input parameter |
NA |
|
Sample Code |
this.view.animatingtextbox.setReadOnly(); |
|
Return Type |
None |
setReadWrite Method
This method enables the read-write mode of the component.
| Parameter | Value |
|---|---|
|
Syntax |
|
| Input parameter |
NA |
|
Sample Code |
this.view.animatingtextbox.setReadWrite(); |
|
Return Type |
None |
clearText Method
This method removes the user entered text from the input box.
| Parameter | Value |
|---|---|
|
Syntax |
|
| Input parameter |
NA |
|
Sample Code |
this.view.animatingtextbox.clearText(); |
|
Return Type |
None |
setText Method
This method sets the text to the input box in the component.
| Parameter | Value |
|---|---|
|
Syntax |
|
| Input parameter |
|
|
Sample Code |
var text = "This is a sample text"; this.view.animatingtextbox.setText(text); |
|
Return Type |
None |
setErrorText Method
This method sets the error message to be displayed in the component.
| Parameter | Value |
|---|---|
|
Syntax |
|
| Input parameter |
|
|
Sample Code |
var text = "This is a mandatory field"; this.view.animatingtextbox.setErrorText(text); |
|
Return Type |
None |
hideError Method
This method is used to hide the error message in the component.
| Parameter | Value |
|---|---|
|
Syntax |
|
| Input parameter |
NA |
|
Sample Code |
this.view.animatingtextbox.hideError(); |
|
Return Type |
None |
getData Method
This method is used to retrieve the data of the component.
| Parameter | Value |
|---|---|
|
Syntax |
|
| Input parameter |
NA |
|
Sample Code |
var data = {
text: "john.doe@temenos.com",
isMasked: false,
placeholder: "Email ID",
textInputMode: constants.TEXTBOX_INPUT_MODE_ANY,
};
data = this.view.animatingtextbox.getData();
|
|
Return Type |
A JSON object with the following key-value pairs.
|
getText Method
This method is used to retrieve the user entered text in the TextBox widget of the component.
| Parameter | Value |
|---|---|
|
Syntax |
|
| Input parameter |
NA |
|
Sample Code |
var text = "This is a sample text"; text=this.view.animatingtextbox.getText(); |
|
Return Type |
|
onBeginEditingCallback Event
This event is triggered when the user starts entering text into the input box. When this event is triggered, the component executes the function set in the setData method.
| Parameter | Value |
|---|---|
| Input parameter |
|
| Programmatic Name | onBeginEditingCallback
|
|
Sample Code |
this.onBeginEditingCallback(text); |
|
Return Type |
NA |
onEndEditingCallback Event
The onEndEditingCallback event is triggered when the user has finished entering the text in the input box. This event is triggered when the user clicks on any of the following options.
- Another focusable widget on the screen such as TextBox.
- Done button on the Next-Previous bar.
- Done button on the soft keypad.
When this event is triggered, the component executes the function set in the setData method.
| Parameter | Value |
|---|---|
| Input parameter |
|
| Programmatic Name | onEndEditingCallback
|
|
Sample Code |
this.onEndEditingCallback(text); |
|
Return Type |
NA |
onDoneCallback Event
This callback is triggered when the user clicks the enter key, Done key, or Go buttons in the soft keypad. When this event is triggered, the component executes the function set in the setData method.
| Parameter | Value |
|---|---|
| Input parameter |
|
| Programmatic Name | onDoneCallback
|
|
Sample Code |
this.onDoneCallback(text); |
|
Return Type |
NA |
onTextChangeCallback Event
This event is triggered when the text inside the input box is modified. When this event is triggered, the component executes the function set in the setData method.
| Parameter | Value |
|---|---|
| Input parameter |
|
| Programmatic Name | onTextChangeCallback
|
|
Sample Code |
this.onTextChangeCallback(text); |
|
Return Type |
NA |
onClearCallback Event
This callback is triggered when the user clicks the clear button of the component. When this event is triggered, the component executes the function set in the setData method.
| Parameter | Value |
|---|---|
| Input parameter |
NA |
| Programmatic Name | onClearCallback
|
|
Sample Code |
this.onClearCallback(); |
|
Return Type |
NA |
In this topic