Class Accordion.OpenedChangeEvent

    • Constructor Detail

      • 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 Detail

      • 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.