I have a JSF-App with two @ViewAccessScoped
Beans and two Pages/Views, one Bean for a Search, on Bean for details. The details Bean references the @ViewAccessScoped so the data available when I go back to the Search. No other CDI-References. The WindowRenderMode is ClientWindowRenderMode.CLIENTWINDOW
, no further configuration.
This works quite well so far. The Beans get un-scoped if i go to another page or logout. One Problem I Experienced: When I open my details page in a new Browser tab, two new Beans are created, which is the expected Behavior. But when i close the tab, the Beans are still there. I guess the Server doesn't get notified when a tab get's closed.
- Is there a built-in solution in deltaspike i can use to detect tab clsoes?
- Is there a Timeout for Beans with @ViewAccessScoped (beside the Session-Timeout)?
- If there isn't a bulit-in solution: How can i programmatically un-scope my Beans? Preferably un-scope all Beans connected to that tab (=same Window-ID) (I'd detect the close my self with JavaScript and call a Bean-Method on close)