Files
spring-shell/spring-shell-docs/modules/ROOT/pages/using-shell-components-ui-multiselect.adoc
2023-08-03 11:11:12 -05:00

35 lines
955 B
Plaintext

[[using-shell-components-ui-multiselect]]
==== Multi Select
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
The multi select component asks a user to select multiple items from a list.
The following listing shows an example:
====
[source, java, indent=0]
----
include::{snippets}/UiComponentSnippets.java[tag=snippet7]
----
====
The following image shows a typical multi-select component:
image::images/component-multi-select-1.svg[text input]
The context object is `MultiItemSelectorContext`. The following table describes its context variables:
[[multiitemselectorcontext-template-variables]]
.MultiItemSelectorContext Template Variables
|===
|Key |Description
|`values`
|The values returned when the component exists.
|`rows`
|The visible items, where rows contain maps of name, selected, on-row, and enabled items.
|`model`
|The parent context variables (see <<selectorcomponentcontext-template-variables>>).
|===