Text box
The text box component lets users enter text, unlike the static text component. For example, you can use it as a search box on a page. This article describes how to configure the text box component.
Step 1: Add the component
-
Create a mobile application. For details, see Create a mobile application.
-
In the mobile application editor, click the Components icon
on the left. -
(Optional) Add column components to set up the layout of your application page. For details, see Horizontal and vertical columns.
-
In the search box above the component list on the left side of the canvas, enter text box. Find the component and drag it onto the canvas.
For more information about adding components, see Add a component.
Step 2: Configure the data source
-
In the Style panel on the right side of the mobile application editor, click Configure Data Source next to Display Data.
-
On the Data Source Configuration page, configure the data source.
Available data source types include device, interface, app push, and page variable.
NoteData returned from an interface or device data source must be a string.
-
Click OK to complete the configuration.
Step 3: Configure styles
-
In the Style panel on the right side of the mobile application editor, configure the component's appearance.
Parameter
Description
Size
Sets the size of the text box.
Placeholder
Sets the placeholder text that appears before a user enters a value. For example, "Enter device name".
Character limit
Sets the maximum number of characters a user can enter. Each Chinese character counts as one character. The minimum value is 1, and the default value is 30.
ImportantThe character limit is a required field.
Default value
Sets the default content displayed in the text box.
Style
Configures visual styles for the text box, including text color, border color, fill color, and cursor color. You can also set the component to read-only or disabled.
-
Adjust the component's dimensions and its position on the page. For more information, see General styles.
Step 4: Configure interactions
-
In the Interaction panel on the right side of the mobile application editor, click Add Interaction to set an event and action.
This component supports the value change event. For example, you can use the Call Other Services action to call an interface and refresh data when the component's value changes.
For details, see Interaction configuration.
-
Preview and debug the component's data and appearance. For details, see Preview and debug.