I am looking for recommendations on preserving bean values between views using JSF 2.
Consider the following scenario:
* In view A, an ABean bean scope is created and retrieves data for display in the view.
* In mind A, you can click on a record to view the details for it. B. * When you return from view B to view A, data previously retrieved by ABean is displayed.
What is the best way to save the data obtained by ABean in order to be able to display it again when returning from view B?
Retrieving data again, which usually happens because a new ABean instance is created when returning from view B, is not an option, as it is time consuming and leads to poor user experience.
If ABean is a session area, this is not an option, because if you leave the page and then return, instead of “receiving” data, “cached” data will be displayed (i.e. you cannot determine if you are loading A view as a result of navigation on page or if you are returning from view B).
What I'm looking for is obviously a conversation area that understands this perfectly (and this is what we had before when using JSF 1 and WebFlow). Unfortunately, the JSF does not have this, and since we are in a portlet environment, we cannot use CDI.
Any thoughts?
source share