I need to reload navigation target

I am using vaadin 24.3.12 and I have a view, where the user changes some permissions and after that I need to reload the application or navigate to the mainLayout and reload (like to enter the application again) but I am not getting it. I am navigating to the destination view but it is not reloading.

@Route(value = ‘UserConfigurationView’, layout = MainLayout.class)
public class UserConfigurationView extends VerticalLayout
public class MainLayout extends AppLayout

I have also tried this…


UI.getCurrent().navigate(MainLayout.class,new RouteParameters(‘reload’, ‘true’));

TargetView (Parameter is always null):

public class MainLayout extends AppLayout implements BeforeEnterObserver.

    public void beforeEnter(BeforeEnterEvent event) {
        String reload = event.getRouteParameters().get(‘reload’).
        if (reload != null) {

Could you help me pls?
Thanks in advance.

RouteParameter should be used in combination with route parameters or route templates (e.g. @Route("mypath/:reload").

You can make your class a parameter/template view or use query parameters (event.getLocation().getQueryParameters().getParameters("reload").

Another solution to do force page reload could be to use UI.getCurrent().getPage().setLocation("/home");

1 Like

The easiest way to reload the page and rebuild the component annotated with @UIScope is to call UI.getCurrent().getPage().reload(); or getUI().ifPresent( ui -> ui..getPage().reload())


Thank you @marcoc_753 !

Thank you @Jean-Christophe.1 !!