Class UnloadEvent

java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<UnloadObserver>
org.vaadin.miki.superfields.unload.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:
  • Field Summary

    Fields inherited from class java.util.EventObject

    source
  • Constructor Summary

    Constructors
    Constructor
    Description
    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks whether or not the event has been fired in response to querying the user on beforeunload browser event.

    Methods inherited from class com.vaadin.flow.component.ComponentEvent

    getSource, isFromClient, unregisterListener

    Methods inherited from class java.util.EventObject

    toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

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

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