Package io.jmix.flowui.view.navigation
Class ViewNavigator
java.lang.Object
io.jmix.flowui.view.navigation.ViewNavigator
- Direct Known Subclasses:
DetailViewNavigator
,ListViewNavigator
Provides a fluent interface to configure navigation parameters and navigate to a
View
.
An instance of this class should be obtained through ViewNavigators.view(String)
or
ViewNavigators.view(Class)
.
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected final Consumer<ViewNavigator>
protected com.vaadin.flow.router.QueryParameters
protected com.vaadin.flow.router.RouteParameters
protected String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionOptional<com.vaadin.flow.router.QueryParameters>
Optional<com.vaadin.flow.router.RouteParameters>
boolean
void
navigate()
Perform navigation to the view configured usingwithViewId(String)
orwithViewClass(Class)
.withBackwardNavigation
(boolean backwardNavigation) Sets whether the current url should be navigated to when the opened view is closed.withQueryParameters
(com.vaadin.flow.router.QueryParameters queryParameters) Sets URL query parameters.withRouteParameters
(com.vaadin.flow.router.RouteParameters routeParameters) Sets URL route parameters.withViewClass
(Class<? extends View> viewClass) Sets the opened view by its class.withViewId
(String viewId) Sets the opened view by id.
-
Field Details
-
handler
-
viewId
-
viewClass
-
routeParameters
protected com.vaadin.flow.router.RouteParameters routeParameters -
queryParameters
protected com.vaadin.flow.router.QueryParameters queryParameters
-
-
Constructor Details
-
ViewNavigator
-
-
Method Details
-
withViewId
Sets the opened view by id.- Parameters:
viewId
- identifier of the view as specified in theViewController
annotation- Returns:
- this instance for chaining
-
withViewClass
Sets the opened view by its class.- Parameters:
viewClass
- view class- Returns:
- this instance for chaining
-
withRouteParameters
public ViewNavigator withRouteParameters(@Nullable com.vaadin.flow.router.RouteParameters routeParameters) Sets URL route parameters.- Parameters:
routeParameters
- route parameters- Returns:
- this instance for chaining
-
withQueryParameters
public ViewNavigator withQueryParameters(@Nullable com.vaadin.flow.router.QueryParameters queryParameters) Sets URL query parameters.- Parameters:
queryParameters
- query parameters- Returns:
- this instance for chaining
-
getViewId
- Returns:
- identifier of the opened view as specified in the
ViewController
annotation
-
getViewClass
- Returns:
- opened view class
-
getRouteParameters
- Returns:
- URL route parameters
-
getQueryParameters
- Returns:
- URL query parameters
-