Search in sources :

Example 1 with NotFoundScreen

use of com.haulmont.cuba.web.app.ui.navigation.notfoundwindow.NotFoundScreen in project cuba by cuba-platform.

the class ScreenNavigationHandler method handle404.

protected void handle404(String route, AppUI ui) {
    MapScreenOptions options = new MapScreenOptions(ParamsMap.of("requestedRoute", route));
    NotFoundScreen notFoundScreen = ui.getScreens().create(NotFoundScreen.class, OpenMode.NEW_TAB, options);
    NavigationState state = new NavigationState(ui.getUrlRouting().getState().getRoot(), "", route, Collections.emptyMap());
    ((WebWindow) notFoundScreen.getWindow()).setResolvedState(state);
    notFoundScreen.show();
}
Also used : NavigationState(com.haulmont.cuba.gui.navigation.NavigationState) MapScreenOptions(com.haulmont.cuba.gui.screen.MapScreenOptions) NotFoundScreen(com.haulmont.cuba.web.app.ui.navigation.notfoundwindow.NotFoundScreen) WebWindow(com.haulmont.cuba.web.gui.WebWindow)

Aggregations

NavigationState (com.haulmont.cuba.gui.navigation.NavigationState)1 MapScreenOptions (com.haulmont.cuba.gui.screen.MapScreenOptions)1 NotFoundScreen (com.haulmont.cuba.web.app.ui.navigation.notfoundwindow.NotFoundScreen)1 WebWindow (com.haulmont.cuba.web.gui.WebWindow)1