Class MessageList.AttachmentClickEvent

java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<MessageList>
com.vaadin.flow.component.messages.MessageList.AttachmentClickEvent
All Implemented Interfaces:
Serializable
Enclosing class:
MessageList

@DomEvent("attachment-click-flow") public static class MessageList.AttachmentClickEvent extends com.vaadin.flow.component.ComponentEvent<MessageList>
Event fired when an attachment is clicked in the message list.

Note: This event listens to the attachment-click-flow event dispatched by the connector, which enriches the web component's attachment-click event with item and attachment indexes.

See Also:
  • Constructor Details

    • AttachmentClickEvent

      public AttachmentClickEvent(MessageList source, boolean fromClient, @EventData("event.detail.itemIndex") int itemIndex, @EventData("event.detail.attachmentIndex") int attachmentIndex)
      Creates a new attachment click event.
      Parameters:
      source - the source component
      fromClient - whether the event originated from the client
      itemIndex - the index of the message item containing the clicked attachment
      attachmentIndex - the index of the clicked attachment within the item's attachments list
  • Method Details

    • getItem

      public MessageListItem getItem()
      Gets the message item containing the clicked attachment.
      Returns:
      the message item
    • getAttachment

      public MessageListItem.Attachment getAttachment()
      Gets the clicked attachment.
      Returns:
      the clicked attachment