com.vaadin.flow.component.messages.
Class MessageInput
All Implemented Interfaces:
AttachNotifier, DetachNotifier, HasElement, HasEnabled, HasSize, HasStyle, HasTooltip, Serializable
Message Input allows users to author and send messages. The component displays a text-area to input a message and a button to send it. The user can send the message with one of the following actions:
- by pressing Enter (use Shift + Enter to add a new line)
 - by clicking the ?send? button.
 
MessageList component to show messages that users have sent.
Author:
Vaadin Ltd.
See Also:
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe
submitevent which is fired byMessageInputcomponent. - 
Constructor Summary
ConstructorsConstructorDescriptionCreates a new message input component.
Creates a new message input component with the provided listener that gets invoked when the user submits a new message.
 - 
Method Summary
Modifier and TypeMethodDescriptionAdds a listener that is called when the user submits the value of the input field, which can be obtained with
MessageInput.SubmitEvent.getValue().getI18n()Gets the internationalization object previously set for this component.
voidsetI18n(MessageInputI18n i18n) Sets the internationalization properties for this component.
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipText 
- 
Constructor Details
- 
MessageInput
public MessageInput()Creates a new message input component.
 - 
MessageInput
Creates a new message input component with the provided listener that gets invoked when the user submits a new message.
Parameters:
listener- the submit event listenerSee Also:
 
 - 
 - 
Method Details
- 
addSubmitListener
Adds a listener that is called when the user submits the value of the input field, which can be obtained with
MessageInput.SubmitEvent.getValue().The event is fired when clicking the Send button or pressing the Enter key.
Parameters:
listener- the listenerReturns:
registration for removal of the listener
 - 
getI18n
Gets the internationalization object previously set for this component.
Note: updating the object content returned by this method will not update the component if not set back using
setI18n(MessageInputI18n).Returns:
the i18n object, or
nullif one has not been set withsetI18n(MessageInputI18n) - 
setI18n
Sets the internationalization properties for this component. It enabled you to customize and translate the language used in the message input.
Note: updating the object properties after setting the i18n will not update the component. To make the changes effective, you need to set the updated object again.
Parameters:
i18n- the i18n object, notnull 
 -