Hopefully someone can explain some behavior to me. I have a JSF page with a datatable and checkboxes. I have a Primefaces command button that does some stuff and then re-renders the table via ajax. This all works as expected however I have a problem. When I click the back button and then the forward button the datatable page is redisplayed in it’s pre-ajax state. From firebug I can see a new Post request being sent on the page forward. I need the forward to display the page post-ajax. If you look at the Primefaces showcase – http://www.primefaces.org/showcase/ui/datatableRowSelectionRadioCheckbox.jsf this works as I want. In the checkbox table if you click a couple of checkboxes and then click view a dialog pops up. Now click back and forward and the page is as you left it. There is NO additional post/get request sent on the page forward.
Any ideas how Primefaces is achieving this?
PrimeFaces isn’t doing that. It’s your browser who’s doing that. Your browser has apparently relatively agressive cache settings on GET requests. Try a different browser like Chrome and you’ll see that you cannot reproduce the same.
This is out of your control. You can at highest replace the POST navigation on your webapp by a GET navigation.