addObjectInput
Provides an input mechanism for PIN code entry.
The input object collects characters from buttons whose id is a single character, such as "1" or "2".
wizCtl.addObjectInput(id, data)
| Parameter | Description |
|---|---|
| id | String that identifies the object. Can be |
| data | Object with the following fields:
|
| Return values |
|---|
| The added input object. Throws an exception if an error occurs. |
The returned object has the following property:
| Property | Description |
|---|---|
onInput | Function called each time an input button is tapped. It receives the following parameters: text (the whole input), inputId (the id of the button tapped), minLength and maxLength. |
Use addObjectInputEcho to show the entered characters on the pad.
The following example adds an input that accepts up to four characters:
const inputObject = wizCtl.addObjectInput("Input", {minLength: 1, maxLength: 4});
inputObject.onInput = function(text, inputId, minLength, maxLength) {
console.log("Pressed " + inputId + ", the text is " + text);
}
wizCtl.addObjectButton("1", 100, 80, "1", 40);
wizCtl.addObjectButton("2", 150, 80, "2", 40);
wizCtl.addObjectButton("delete", 100, 130, "<< Delete", 90);