Let me clarify. Say I have a list of products displayed depending on which category a user selects. Now say the user selects a different category, the list is repopulated with the new data and the user is happy. Now say the customer clicks the back button instead of using page navigation to go back to the first list. Although the page is displaying the old list, the bean where the list resides (and where the data for h:dataTable is bound) has the new list/data. Now, the customer clicks 'add to cart' on an item from the old list. As expected, the respective item in the new list is added to cart even though the customer wanted the one from the old list.
Let me try to illustrate to make this more clear.
<products.jsf>
<products.jsf> after the customer clicks on a different category (which i currently have shown on a sidebar)
After the user clicks his browser's back button, the page displays the first list but the bean contains the second list. If he tries to add Item 1 to cart from that page, it actually adds Item 4.
Now, this is about what I expected, but I was wondering if there is any way around this? Even if I can't make it add the correct item, I was hoping that it would recognize that something was wrong and maybe error out.
JSF seems to handle multiple windows/tabs from the same session very poorly and also does not seem to work well with browser navigation.
So, any ideas? Am I setting it up completely wrong to begin with? Thanks in advance!
John