title: When does a JSF 2.0 ViewScoped Bean die?
body: <p>I would like to have a Ajax-Based Tabbed interface in my website.</p>
  
  <p>I would also like to have a bean for each of the tabs.<br>
  These beans are expected to be "<em>born</em>" when entering the tab and "<em>die</em>" when leaving the tab.</p>
  
  <p><strong>Important</strong> - The switch between tabs must be an AJAX event and not a full page redraw.</p>
  
  <p>I thought <code>@ViewScoped</code> is the appropriate scope for this type of behaviour but I am stuck on the issue of killing the bean when leaving a tab. To my best knowledge, a <code>@ViewScoped</code> bean will only die on a redirect/navigation event.</p>
  
  <p>Is there a proper way to make the <code>@ViewScoped</code> bean die? Should I use a different scope?</p>
  
  <p>Thanks!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Reading BalusC's answer on <a href="https://stackoverflow.com/questions/4831888/does-view-scope-bean-survive-navigation-jsf">this</a> question is good indication:</p>
  
  <blockquote>
    <p>A view scoped bean lives as long as you interact with the same view
    (i.e. you return void or null in bean action method). When you
    navigate away to another view, e.g. by clicking a link or by returning
    a different action outcome, then the view scoped bean will be trashed
    by end of render response and not be available in the next request.</p>
  </blockquote>
  
  <p>So, according to this, I could return a different outcome from an action method and make the <code>@ViewScoped</code> bean die.<br>
  But to do this I have to disable navigation after an outcome from an action method (JSF 2 implicit navigation) and I don't know how to do that (or if that's the right way to achieve my goal)</p>