public class NavigationEvent extends EventObject
source| Constructor and Description |
|---|
NavigationEvent(Router router,
Location location,
UI ui,
NavigationTrigger trigger)
Creates a new navigation event.
|
NavigationEvent(Router router,
Location location,
UI ui,
NavigationTrigger trigger,
elemental.json.JsonValue state,
boolean forwardTo)
Creates a new navigation event.
|
| Modifier and Type | Method and Description |
|---|---|
Location |
getLocation()
Gets the new location.
|
Router |
getSource() |
Optional<elemental.json.JsonValue> |
getState()
Gets navigation state.
|
NavigationTrigger |
getTrigger()
Gets the type of user action that triggered this navigation event.
|
UI |
getUI()
Gets the UI in which the navigation occurs.
|
boolean |
isForwardTo()
Checks whether this event is created as a result of
BeforeEvent.forwardTo(com.vaadin.flow.router.NavigationHandler, com.vaadin.flow.router.NavigationState) or not. |
toStringpublic NavigationEvent(Router router, Location location, UI ui, NavigationTrigger trigger)
router - the router handling the navigation, not nulllocation - the new location, not nullui - the UI in which the navigation occurs, not nulltrigger - the type of user action that triggered this navigation event,
not nullpublic NavigationEvent(Router router, Location location, UI ui, NavigationTrigger trigger, elemental.json.JsonValue state, boolean forwardTo)
router - the router handling the navigation, not nulllocation - the new location, not nullui - the UI in which the navigation occurs, not nulltrigger - the type of user action that triggered this navigation event,
not nullstate - includes navigation state info including for example the
scroll position and the complete href of the RouterLinkforwardTo - indicates if this event is created as a result of
BeforeEvent.forwardTo(com.vaadin.flow.router.NavigationHandler, com.vaadin.flow.router.NavigationState) or notpublic Router getSource()
getSource in class EventObjectpublic Location getLocation()
nullpublic UI getUI()
public NavigationTrigger getTrigger()
nullpublic Optional<elemental.json.JsonValue> getState()
public boolean isForwardTo()
BeforeEvent.forwardTo(com.vaadin.flow.router.NavigationHandler, com.vaadin.flow.router.NavigationState) or not.true if this event is created as a result calling
BeforeEvent.forwardTo(com.vaadin.flow.router.NavigationHandler, com.vaadin.flow.router.NavigationState), false otherwiseCopyright © 2025. All rights reserved.