public class RouterLinkHandler extends Object
Events are sent to server for handling.
| Modifier and Type | Method and Description |
|---|---|
static void |
bind(Registry registry,
elemental.dom.Element element)
Adds a click event listener for the given element for intercepting
application navigation related click events and sending them to server.
|
static boolean |
isInsidePageNavigation(String path,
boolean hasFragment)
Checks whether the given path is for navigating inside the same page as
the current one.
|
static void |
sendServerNavigationEvent(Registry registry,
String location,
Object stateObject,
boolean routerLinkEvent)
Notifies the server about navigation to the given location.
|
public static void bind(Registry registry, elemental.dom.Element element)
registry - the registryelement - the element to listen to click events inpublic static boolean isInsidePageNavigation(String path, boolean hasFragment)
If the paths are different, it is always outside the current page
navigation. If they are the same, then it depends on whether the new href
has any hash #.
path - the path to check againsthasFragment - the true if the navigated url contains a
fragment,false if nottrue if the given location is for navigating inside
the current page, false if notpublic static void sendServerNavigationEvent(Registry registry, String location, Object stateObject, boolean routerLinkEvent)
Ensures that navigation works even if the session has expired.
registry - the registrylocation - the location to navigate to, relative to the base URIstateObject - the state object or null if none applicablerouterLinkEvent - true if this event was triggered by interaction
with a router link; false if triggered by history
navigationCopyright © 2000–2021 Vaadin Ltd. All rights reserved.