com.vaadin.flow.component.UI.navigate()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(215)

本文整理了Java中com.vaadin.flow.component.UI.navigate()方法的一些代码示例,展示了UI.navigate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UI.navigate()方法的具体详情如下:
包路径:com.vaadin.flow.component.UI
类名称:UI
方法名:navigate

UI.navigate介绍

[英]Updates this UI to show the view corresponding to the given navigation target.

Besides the navigation to the location this method also updates the browser location (and page history).
[中]更新此UI以显示与给定导航目标对应的视图。
除了导航到位置之外,此方法还更新浏览器位置(和页面历史记录)。

代码示例

代码示例来源:origin: com.vaadin/flow-server

/**
 * 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());
}

代码示例来源:origin: appreciated/vaadin-app-layout

public void navigateTo() {
  UI.getCurrent().navigate(getRoute());
}

代码示例来源:origin: appreciated/vaadin-app-layout

public void navigateTo() {
  UI.getCurrent().navigate(getRoute());
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * 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));
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * 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));
}

相关文章