com.vaadin.flow.component.accordion.

Class Accordion.OpenedChangeEvent

java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<Accordion>
com.vaadin.flow.component.accordion.Accordion.OpenedChangeEvent

All Implemented Interfaces:

Serializable

Enclosing class:

Accordion

@DomEvent("opened-changed") public static class Accordion.OpenedChangeEvent extends ComponentEvent<Accordion>

An event fired when an Accordion is opened or closed.

See Also:

  • Constructor Details

    • OpenedChangeEvent

      public OpenedChangeEvent(Accordion source, boolean fromClient, @EventData("event.detail.value") Integer index)

      Creates a new event using the given source and indicator whether the event originated from the client side or the server side.

      Parameters:

      source - the source component

      fromClient - true if the event originated from the client

      index - the index of the opened panel or null if the accordion is closed

  • Method Details

    • getOpenedIndex

      public OptionalInt getOpenedIndex()

      Gets the index of the opened panel or null if the accordion is closed.

      Returns:

      the index of the opened panel or null if closed

    • getOpenedPanel

      public Optional<AccordionPanel> getOpenedPanel()

      Gets the opened panel. Caution should be exercised when using this method with an Accordion which along with its panels were created in a template. Such template children would by default not be children of the Accordion Flow component, thus making it possible for this method to return the wrong panel in such cases.

      Returns:

      the opened panel.