Class DashboardItemRemoveEvent

java.lang.Object
com.vaadin.flow.component.dashboard.DashboardItemRemoveEvent
All Implemented Interfaces:
Serializable

public class DashboardItemRemoveEvent extends Object implements Serializable
Event object passed to DashboardItemRemoveHandler when a user attempts to remove an item from the dashboard.

This event provides access to the item being removed, its parent section (if any), and a method to proceed with the removal.

Author:
Vaadin Ltd.
See Also:
  • Method Details

    • getItem

      public com.vaadin.flow.component.Component getItem()
      Returns the item being removed.
      Returns:
      the item being removed, either a DashboardWidget or a DashboardSection
    • getSection

      public Optional<DashboardSection> getSection()
      Returns the parent section if the item is inside a section.
      Returns:
      an Optional containing the parent section, or empty if the item is at the root level
    • removeItem

      public void removeItem()
      Removes the item from the dashboard.

      Call this method to proceed with removal after validation or user confirmation. If this method is not called, the item will remain in the dashboard.