The Select component for Retool Mobile
An input field to select an option using a dropdown menu or manually enter a value.
Options are displayed in a full-screen list box with search filter when there are more than 10 values.
Properties
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
allowCustomValue
Whether to allow values that do not exist in values
.
Type | boolean |
Format | True/False |
Configurability | Inspector |
Default |
|
Examples
true
allowDeselect
Whether to allow deselection of an item.
Type | boolean |
Format | True/False |
Configurability | Inspector |
Default |
|
Examples
true
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean |
Format | True/False |
Configurability | Inspector > Interaction > Disabled |
Default |
|
Examples
true
events
A list of configured event handlers that trigger actions or queries.
Type | array |
Array values | object |
Configurability | Inspector > Interaction > Event handlers |
Array Object Properties
event
The event that triggers the action. Refer to the events section for details of available events for this object.
Type | string |
Configurability | Inspector > Interaction > Event handlers > Event |
method
The JavaScript method to perform when type
is datasource
, widget
, state
, or localStorage
.
Type | string |
Configurability | Inspector > Interaction > Event handlers > Edit event handler > Run script actions |
type
The type of action to perform.
Type | string | ||||||||||||||
Configurability | Inspector > Interaction > Event handlers > Edit event handler > Action | ||||||||||||||
Allowed Values |
|
hidden
Whether this object is hidden from view.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Hidden |
Default |
|
Examples
true
label
The text label to display.
Type | string |
Format | Plain Text |
Configurability | Inspector > Content > Add-ons > Label > Label |
Default |
|
Examples
"Label"
labelCaption
The additional text to display with the label.
Type | string |
Format | Plain Text |
Configurability | Inspector > Content > Add-ons > Label > Caption |
labels
A list of labels for each item. Falls back to the corresponding value
if no label is provided.
Type | array |
Array values | string |
Configurability | Read-only |
Default |
|
Examples
["Label 1", "Label 2", "Label 3"]
placeholder
The text to display within the input field when there is no value.
Type | string |
Format | string |
Configurability | Inspector > Content > Placeholder |
Default |
|
Examples
Enter a value
value
The current or default value.
Type | string |
Format | Plain Text |
Configurability | Inspector > Content > Default value |
Default |
|
Examples
Hello world!
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
select.clearValidation()
Examples
Clear the validation message from select
.
select.clearValidation();
select.clearValue()
Examples
Clear the current value of select
.
select.clearValue();
select.focus()
Examples
Set focus on select
.
select.focus();
select.resetValue()
Examples
Reset the current value of select
.
select.resetValue();
select.setDisabled()
Set the disabled
value to toggle whether the input field is disabled. Defaults to true
without a parameter.
select.setDisabled(disabled)
Parameters
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean |
Format | True/False |
Default |
|
Examples
true
Examples
Disable select
.
select.setDisabled(true);
Enable select
.
select.setDisabled(false);
select.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
select.setHidden(hidden)
Parameters
Examples
true
Examples
Hide select
.
select.setHidden(true);
Unhide select
.
select.setHidden(false);
select.setValue(key, value)
Examples
Set the current value of select
to userValue
.
select.setValue(userValue);
select.validate()
Examples
Validate the value of select
.
select.validate();
Events
Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.
Event | Description |
---|---|
Change | The value is changed. |