Class UnloadEvent

  • All Implemented Interfaces:
    Serializable

    public class UnloadEvent
    extends com.vaadin.flow.component.ComponentEvent<UnloadObserver>
    Server-side event class associated with beforeunload event happening in the client-side. Can optionally prompt the user before leaving the page.
    Since:
    2020-04-29
    Author:
    miki
    See Also:
    Serialized Form
    • Constructor Detail

      • UnloadEvent

        public UnloadEvent​(UnloadObserver source,
                           boolean attempted)
        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
        attempted - when true, the event is fired in response to querying before unloading; false otherwise.
    • Method Detail

      • isBecauseOfQuerying

        public boolean isBecauseOfQuerying()
        Checks whether or not the event has been fired in response to querying the user on beforeunload browser event.
        Returns:
        true when event is in response to querying the user on beforeunload, false otherwise.