I'm looking for best practices regarding preserving bean values between views using JSF 2.
Consider the following scenario:
* In view A, the view scoped bean ABean is instantiated and retrieves data for display in the view.
* In view A you can click on an entry to view details for it in view B.
* When returning from view B to view A, the data previously retrieved by ABean is displayed.
What is the best way to preserve the data retrieved by ABean, to be able to display it again when returning from view B?
Retrieving the data again, which would normally happen since a new instance of ABean is created when returning from view B, is not an option since it's a time-consuming operation and leads to a bad use experience.
Having ABean being session scoped is not an option, since if you leave the page and then return, the "cached" data would be displayed instead of retrieving new data (i.e. you cannot determine if you're loading view A as a result of navigating to the page or if you're returning from view B).
What I'm looking for is obviously a conversation scope, which solves this nicely (and is what we had before, when using JSF 1 and WebFlow). Unfortunately, JSF doesn't have that and since we're in a portlet environment we cannot use CDI.
Any thoughts?