Is there a way to preserve the contents of a tabbed component when toggling between them? I found @PreserveOnRefresh but that only seems to work when refreshing the browser.
Asked
Active
Viewed 100 times
1 Answers
4
Assuming you mean navigating between Routes/views rendered as tabs, I think what you're looking for is the @SpringComponent and @UIScope annotations. Add these to the relevant classes to preserve any input fields and outputs when toggling. Note that you'll still need @PreserveOnRefresh if you want to retain those fields when refreshing the page itself.
See: Vaadin Component as Spring bean for a breakdown of the specific functions the two annotations serve.

schaphekar
- 495
- 1
- 5
- 18