Hi. I’ve already read the vaadin doc about UIScope and Routescope but I don’t manage to implement that. I’ve simply a view A with a grid and a view B that show the detail of the grid item. I’ve used first “UIScope” in my View A to store the grid without reload the constructor when I’m come back from my view B.
But , like the doc explaine that, It’s stored in the UI, so when I leave view A and come back later, it’s always stored.
So I’ve seen that I have to use Routescope but I don’t undestand how to implement that. I change the code “@UIScope” in my view A by “@RouteScope” and “@RouteScopeOwner(A.class)” but it doesn’t work. Have you an example or can you help me to use this function. Thank you in advance
@RouteScopeOwner(A.class)
means that the instance should remain preserved as long as A
remains rendered as a view or a router layout. That is not the case if you navigate away from A
when navigating to B
. You might have to introduce a dummy router layout in between that is shared between the two views and use that layout class as the scope owner.