/** * Updates this UI to show the view corresponding to the given location. The * location must be a relative path without any ".." segments. * <p> * Besides the navigation to the {@code location} this method also updates * the browser location (and page history). * * @see #navigate(String, QueryParameters) * @see Router#navigate(UI, Location, NavigationTrigger) * * @param location * the location to navigate to, not {@code null} */ public void navigate(String location) { navigate(location, QueryParameters.empty()); }
public void navigateTo() { UI.getCurrent().navigate(getRoute()); }
public void navigateTo() { UI.getCurrent().navigate(getRoute()); }
/** * Updates this UI to show the view corresponding to the given navigation * target. * <p> * Besides the navigation to the {@code location} this method also updates * the browser location (and page history). * * @param navigationTarget * navigation target to navigate to */ public void navigate(Class<? extends Component> navigationTarget) { RouteConfiguration configuration = RouteConfiguration .forRegistry(getRouter().getRegistry()); navigate(configuration.getUrl(navigationTarget)); }
/** * Updates this UI to show the view corresponding to the given navigation * target with the specified parameter. The parameter needs to be the same * as defined in the route target HasUrlParameter. * <p> * Besides the navigation to the {@code location} this method also updates * the browser location (and page history). * <p> * Note! A {@code null} parameter will be handled the same as * navigate(navigationTarget) and will throw an exception if HasUrlParameter * is not @OptionalParameter or @WildcardParameter. * * @param navigationTarget * navigation target to navigate to * @param parameter * parameter to pass to view * @param <T> * url parameter type * @param <C> * navigation target type */ public <T, C extends Component & HasUrlParameter<T>> void navigate( Class<? extends C> navigationTarget, T parameter) { RouteConfiguration configuration = RouteConfiguration .forRegistry(getRouter().getRegistry()); navigate(configuration.getUrl(navigationTarget, parameter)); }