You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling UI.getcurrent().refreshCurrentRoute() is supposed to rebuild the current route-target and optionally the whole layout-chain, see parameter refreshRouteChain, but if I use it to refresh a route that triggers a redirect (forward/reroute) in beforeEnter() vaadin seems to discard any new created route-component (including layouts) and reuse previous.
I think the problem is, that in com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.forward(NavigationEvent, BeforeEvent) and com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.reroute(NavigationEvent, BeforeEvent)
the flags "forceInstantiation" and "recreateLayoutChain" of the current NavigationEvent aren't propagated to the new NavigationEvent created by com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.getNavigationEvent(NavigationEvent, BeforeEvent)
Expected behavior
The route-chain should also be refreshed/recreated if a redirect was triggered inside beforeEnter() of the route-target.
Description of the bug
Calling UI.getcurrent().refreshCurrentRoute() is supposed to rebuild the current route-target and optionally the whole layout-chain, see parameter refreshRouteChain, but if I use it to refresh a route that triggers a redirect (forward/reroute) in beforeEnter() vaadin seems to discard any new created route-component (including layouts) and reuse previous.
I think the problem is, that in
com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.forward(NavigationEvent, BeforeEvent)
andcom.vaadin.flow.router.internal.AbstractNavigationStateRenderer.reroute(NavigationEvent, BeforeEvent)
the flags "forceInstantiation" and "recreateLayoutChain" of the current NavigationEvent aren't propagated to the new NavigationEvent created by
com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.getNavigationEvent(NavigationEvent, BeforeEvent)
Expected behavior
The route-chain should also be refreshed/recreated if a redirect was triggered inside beforeEnter() of the route-target.
Minimal reproducible example
testrefreshroute.zip
Attributes in the Session are set:
and then refreshCurrentRoute(true) is called (true = refreshRouteChain)
Expected:
header/appbar shows h2 with text "OPTION 1" but nothing shows
Button "Option 2" shows how it should work (= shows Text "OPTION 2" in header/appbar) but without redirects.
Versions
The text was updated successfully, but these errors were encountered: