Vega Simple Select Component
Overview
The Simple Select component is a Vega (v2.0) Primary Fields component that lets end-users select one or more options from a drop-down list. The drop-down list uses a values table, or a data reference key, to display a list of options.
By default, the Simple Select component stays collapsed until the end-user opens it. After making a selection, the list closes again.
You'll find the Simple Select component in the Primary Fields group to the left of the Module Builder.
About the Configuration Window
To learn more about general component settings, view our General Component Settings article.
Display Settings
Field Text
Setting |
Description |
---|---|
Label Text |
Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. User-friendly labels make your module more accessible. Keep labels short and descriptive (a word or two) using title case. For longer entries, use sentence case. |
Placeholder Text |
A short prompt telling end-users the expected value of an input field. For example, Enter your Social Security Number. Placeholder Text displays inside the input field until the end-user begins an entry. |
Formatting
Setting |
Description |
---|---|
Allow Multiple Selections |
When set to (ON), end-users can select multiple options from the drop-down. Each time the end-user clicks an option, its added to the field. |
Render Select Menu as Portal |
When set to (ON), in Express View, the search select field is rendered in the HTML body of the DOM. When set to (OFF), the Search Select field nests in its parent container. By default this setting is (ON). |
Adding a Simple Select Component
Configure a Simple Select component to collect an end-user's education history. You'll configure six options for end-users to select.
These instructions assume that you have an open module saved with a title.
1. | In the Module Builder, drag and drop a Simple Select component onto the canvas. |
2. | In the Property ID field, enter educationHistory. |
3. | In the Label Text field, enter What is the highest level of education you've completed?. |
4. | Navigate to the Data settings. |
5. | In the Values table, enter the following: |
Label |
Value |
|
---|---|---|
1 |
lessThanHighSchool |
Less than High School |
2 |
highSchoolGED |
High School/GED |
3 |
associatesDegree |
Associate's Degree |
4 |
bachelorsDegree |
Bachelor's Degree |
5 |
mastersDegree |
Master's Degree |
6 |
higherEd |
Higher Education |
6. | Navigate to the Validation settings. |
7. | Set Required to (ON). |
8. | Click Save Component. |
9. | Save your module. |
Preview your module in Express View:
Structure of a Simple Select Component's Data
Using the above example, execute the Vega Console command UNQENG.tools.getComponentState('educationHistory') in the DevTools Console to display the component's data structure.
Here's how the same component looks in the DevTools Console: