Inputs
1. Overview
The Inputs components are used to capture data entered by users in various formats, such as text, numbers, dates, selections, and attachments. There are 10 types of input components available on the platform: Text, Large Text, Numeric, Date, Checkbox, Radio Button, Button Selector, Droplist, Attachment, and the deprecated Input with View (not covered here).
Each input generates a variable that can be used in SQL and database actions, such as INSERT, UPDATE, and DELETE. These variables are fundamental for dynamic interactions with the database.
For more practical details on using inputs, we recommend watching the EAD video on satisfaction surveys. The section about inputs starts specifically at minute 14:30.
2. How to Configure
2.1. Input Variables
When creating an input, a variable is automatically generated in the format :INPUT_ID, where "ID" corresponds to the unique identifier of each input created. This variable can be used in SQL queries and DMLs (Data Manipulation Language).
2.2. Input Title, Placeholder, and Helper Text
Input Title: The input title visually appears above the component.
Placeholder: Text that appears inside the input to guide the user on what to enter.
Helper Text: Text that appears below or beside the input to provide additional information.
2.3. Formatting
Text Inputs: Can be formatted as email, URL, and more.
Numeric Inputs: Can be formatted as currency, percentage, phone number, CPF, CNPJ, postal code (CEP), and others.
2.4. Mandatory Fields
Inputs can be configured as mandatory. When an input is mandatory, it must be filled in before allowing an associated action to be executed.
You can link the button that will require the mandatory input to be filled. For example, if two inputs are mandatory, the submission button will only activate when all required inputs are completed.
2.5. Initial Content
The initial content of an input can be set via SQL. This functionality is useful for pre-filling the input with a value based on existing data. For example, on a screen that already filters an executive, the executive's name can be retrieved and displayed in the input, allowing the user to edit the name before saving.
3. Inputs with Options (Checkbox, Radio Button, Button Selector, Droplist)
The Checkbox, Radio Button, Button Selector, and Droplist components are slightly more complex as they require defining options.
3.1. Options Source
Static: Manually define the ID and description for each item.
Table: Options are automatically generated from an existing table.
SQL: Options are defined based on an SQL query that you configure.
3.2. Selection Behavior
Checkbox: Allows the selection of multiple items.
Radio Button: Allows the selection of only one item.
Droplist: Can be configured to allow single or multiple selections.
Button Selector: Functions like a radio button but with a more modern and visually appealing design. It allows adding icons to each option, making it ideal for interfaces requiring a more sophisticated presentation.
3.3. Button Selector Configuration
You can configure an SQL query to return the ID, description, and icon for each option. The component will display the options horizontally with the associated icons, creating a stylish and functional button selector.