Interface AIInput
- All Superinterfaces:
Serializable
- Since:
- 25.3
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddSubmitListener(com.vaadin.flow.function.SerializableConsumer<String> listener) Adds a listener for submit events.default booleanGets whether submitting input is disabled.default voidsetSubmitDisabled(boolean submitDisabled) Sets whether submitting input is disabled.
-
Method Details
-
addSubmitListener
Adds a listener for submit events.The listener is notified with the submitted value when the user submits input.
- Parameters:
listener- the listener to add, notnull
-
setSubmitDisabled
default void setSubmitDisabled(boolean submitDisabled) Sets whether submitting input is disabled. While disabled, the user can still type, but cannot submit, and the typed text is kept.The
AIOrchestratordisables submitting while it processes a request, and while a file is being uploaded to a file receiver that is anUploador anUploadManager. During an upload, the browser shows this only when server push or polling is enabled. The orchestrator only enables submitting again if it disabled it, seeisSubmitDisabled(). The default implementation does nothing.Disabling submitting while the orchestrator has it disabled, for example in a
response listener, does not last: the orchestrator enables submitting when the request and the uploads have ended. To keep the user from sending more messages, disable the input component itself, for example withsetEnabled(false)on aMessageInput, or reject the prompts in arequest interceptor.- Parameters:
submitDisabled-trueto disable submitting,falseto enable it- Since:
- 25.4
-
isSubmitDisabled
default boolean isSubmitDisabled()Gets whether submitting input is disabled.The
AIOrchestratorleaves submitting disabled when it is already disabled, for example by the application, at the time the orchestrator would disable it. The default implementation returnsfalse.- Returns:
trueif submitting is disabled,falseotherwise- Since:
- 25.4
-