2

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.

samwatts
  • 111
  • 8

1 Answers1

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