New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document how to preserve beans with @RouteScope when migrating from v7/v8 #6395
Comments
This is related to #6287 |
Hi, |
One usecase is to store data per tab, for example having seperate login sessions for each tab. https://vaadin.com/forum/thread/17810577/17812148 presents a hack, which has several problems. |
We've decided that this is not worth it - it would be tricky to implement technically which would make the ROI very low. Instead you should use other means of storing data to be preserved in the UI - like in case of using CDI/Spring DI - use a Acceptance Criteria
|
It's still unfortunate if not downright detrimental that |
Prerequisites:
we have ticket vaadin/spring#473 and vaadin/cdi#293 which are about not preserving UIScopes beans on refresh.
The tickets are in fact consequence of confusion.
But the main idea is still valid: the developer want to preserve on refresh the whole
UI
instance (instead of specific components) and expects that UIScoped beans are preserved.@PreserveOnRefresh
doesn't fit the expectations and there is a reason for this: it's attached not the aUI
instance but rather for a specific route target/component. So it may not work preserving UI beans since one route target may be preserved and another may be not.What we need is: a way (most likely not via an annotation since we don't recommend to use your own UI instances) to make
UI
to be preserved on refresh. It may be a (deployment) config parameter or something else.The way how it works: the whole UI is preserved on refresh (the instance doesn't have to be preserved but all ui scoped beans should be preserved): the ui scope should stay the same when UI is refreshed.
The text was updated successfully, but these errors were encountered: