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

32 lines
864 B
Plaintext

[[using-shell-components-ui-confirmation]]
==== Confirmation
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
The confirmation component asks a user for a simple confirmation. It is essentially a
yes-or-no question.
====
[source, java, indent=0]
----
include::{snippets}/UiComponentSnippets.java[tag=snippet5]
----
====
The following image shows the typical output from a confirmation component:
image::images/component-confirmation-1.svg[text input]
The context object is `ConfirmationInputContext`. The following table describes its context variables:
[[confirmationinputcontext-template-variables]]
.ConfirmationInputContext Template Variables
|===
|Key |Description
|`defaultValue`
|The default value -- either `true` or `false`.
|`model`
|The parent context variables (see <<textcomponentcontext-template-variables>>).
|===