Text (deprecated)

Draft comment:
This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-03-13 12:15
Text creates a text-input field that has an optional label and placeholder text.

Restrictions and limitations

Limitations
Attention: If the user types in data that fails the validation that the browser specifies for the text input type, the bound data item is null when the user triggers a boundary event such as clicking a button. For example, if you set the text input type configuration option to Email and the data that the user types into it does not include the @ symbol, that data is not saved. If the flow returns to the coach, the view is empty. Any other views bound to the same data item are also empty.

Data binding

Set the data binding for the view in the General properties tab.
Table 1. Data binding for Text
Binding description Data type
The bound data item contains a String value that the view displays. The String can initially be empty. If the visibility of the view is not read only, the view saves to the bound data item any String that the user enters into it. String

Theme definitions

The design mode of the theme editor contains a simulation of this view. If you hover over the simulation, it lists the theme definitions that determine the appearance of the view. For information on the theme editor, see Creating themes.

Configuration properties

Set or modify view configuration in the Configuration properties tab.
Screen size
A configuration property that has the Screen Sizes icon The Screen Sizes icon beside the property name can have different values for each screen size. If you do not set a value, the screen size inherits the value of the next larger screen size as its default value.
Table 2. Configuration properties for Text
Configuration property Description Data type
Placeholder hint Add a brief description or example of the input required by the user. If the bound data item does not contain a value, users see the hint until they type in the field. String
Autocompletion > Enable autocompletion To have the field display suggestions based on what the user has typed, select this option. If you enable autocompletion, you must specify an autocompletion service.

The default value is not selected (False).

Boolean
Autocompletion > Autocompletion service Specify the service that provides type-ahead content assistance. Business Automation Workflow provides the default autocompletion service to show the API for this service. You must provide your own service implementation. Service
  • Input: text(String)
  • Output: results(String)(List)
Autocompletion > Autocompletion delay Specify the number of milliseconds to wait following the last keystroke before sending the input text to the autocompletion service.

The default value is 1000.

Integer
Validation Specify the JavaScript regular expression used to validate what the user has entered into the field.
Enter the pattern portion of the JavaScript regular expression as a string. For example, use\d* to validate against zero or more digits. If you set this field to a string variable instead, surround the content in the variable with quotation marks and use escape characters where necessary. For example, use"\\d*" to validate against zero or more digits.
Restriction: If the browser running the application does not support the HTML5 tel type, then validation cannot be performed on entries with the Telephone text input type.
String
Text input type Provide a hint to the device or browser that identifies the type of text input to expect so that the appropriate keyboard is displayed to the user. Selections include Text (default), URL, Email, and Telephone For example, Telephone indicates that a numeric keyboard might be displayed when a user edits the text field.
When URL or Email is selected for the input type, the field might be subject to data-type validation at run time if the device or browser supports it.
Restriction: This feature does not work on devices or browsers that do not natively support it.
TextInputTypes
Maximum length Set the maximum number of characters that a user can type into the field. Integer
Style > Text size screen sizes icon Set the size of the text in the view, the size of the label text, and the amount of padding around the text. For example, to make the text and label more readable on smart phones, you can set this configuration option to Large for the small screen size.

The default value is Medium.

String