Package com.vaadin.flow.component.page
Class History.HistoryStateChangeEvent
java.lang.Object
java.util.EventObject
com.vaadin.flow.component.page.History.HistoryStateChangeEvent
- All Implemented Interfaces:
Serializable
- Enclosing class:
- History
Event fired when the history state has changed.
This happens when PopStateEvent
is fired in the browser, or
when routing has been triggered by user clicking a link marked with
attribute "router-link".
Note that this event is not fired when only the hash has changed!
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionHistoryStateChangeEvent
(History history, elemental.json.JsonValue state, Location location, NavigationTrigger trigger) Creates a new event. -
Method Summary
Methods inherited from class java.util.EventObject
toString
-
Constructor Details
-
Method Details
-
getSource
- Overrides:
getSource
in classEventObject
-
getLocation
Gets the location that was opened. This is relative to the base url.- Returns:
- the location, not null
-
getState
Gets the history state value as JSON.- Returns:
- an optional JSON state value or an empty optional if no state has been provided
-
getTrigger
Gets the type of user action that triggered this history change.- Returns:
- the type of user action that triggered this history change,
not
null
-