Reputation: 644
In Vaadin you can place the PreserveOnRefresh annotation on a route target.
I wonder if there is a way to enable this dynamically since you can't change annotations during runtime.
Back in vaadin 8 we used multiple UI's for this and enabled them based on Spring profiles
Upvotes: 0
Views: 114
Reputation: 4290
At least at the moment, there doesn't seem to be a mechanism for that; there is a method boolean isPreserveOnRefreshTarget
in AbstractNavigationStateRenderer
that returns true
if the annotation is present in the route target type or its parent layouts. I don't see a convenient way of overriding that; I recommend opening a ticket in https://github.com/vaadin/flow/issues
Upvotes: 1