Package io.jmix.ui.navigation
Interface UrlRouting
- All Known Implementing Classes:
WebUrlRouting
public interface UrlRouting
Interface defining methods for reflecting app state to URL based on currently opened screen.
Passed params map enables to reflect inner screen state to URL to use it later.
Can be used only Web client.
Usage example (this - Screen controller):
Passed params map enables to reflect inner screen state to URL to use it later.
Can be used only Web client.
Usage example (this - Screen controller):
@Inject private UrlRouting urlRouting; private void changeUrl() { Map<String, String> params = ParamsMap.of( "param1", "value1", "param2", "value2"); urlRouting.pushState(this, params); }
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Provides API to generate routes for screens with optional URL parameters. -
Method Summary
Modifier and TypeMethodDescriptiongetState()
default void
Pushes the state corresponding to the givenscreen
.void
Pushes the state corresponding to the givenscreen
.default void
replaceState
(Screen screen) Replaces current state by the state corresponding to the givenscreen
.void
replaceState
(Screen screen, Map<String, String> urlParams) Replaces current state by the state corresponding to the givenscreen
.
-
Method Details
-
pushState
Pushes the state corresponding to the givenscreen
.Creates new entry in browser history.
- Parameters:
screen
- screen that is used to build new navigation state
-
pushState
Pushes the state corresponding to the givenscreen
.The given
urlParams
will be reflected in URI as GET request params.Creates new entry in browser history.
- Parameters:
screen
- screen that is used to build new navigation stateurlParams
- URI params map
-
replaceState
Replaces current state by the state corresponding to the givenscreen
.Doesn't create new entry in browser history.
- Parameters:
screen
- screen that is used to build new navigation state
-
replaceState
Replaces current state by the state corresponding to the givenscreen
.The given
urlParams
will be reflected in URI as GET request params.Doesn't create new entry in browser history.
- Parameters:
screen
- screen that is used to build new navigation stateurlParams
- URI params map
-
getState
NavigationState getState()- Returns:
- current state parsed from URI fragment.
-
getRouteGenerator
UrlRouting.RouteGenerator getRouteGenerator()- Returns:
UrlRouting.RouteGenerator
instance
-
getLastHistoryOperation
String getLastHistoryOperation()
-