I’m trying to save the state of a form as it was right when the submit button is clicked (after any edits since the user first visited the page) into browser history as a unique fragment (different from that of the form when first visited), but I’m having a problem. I’m using the fragment utility to do this, by generating a code (number) to represent the form state, and then setting the fragment to include that new code in response to the “submit” button. The idea is that the user can go back to their last edits from the results page, or further to the form as it originally was before that, and so on. This would be great, rich history for the user so I hope I don’t have to give up on this feature.
BUT. The submit button is supposed to also trigger showing results which has its own fragment, and that’s the problem. I need to set (add to browser history) two fragments in then one event response to the submit button being clicked, which is not working. I believe one can’t set two fragments in one back/forth with the server - only the second fragment (the results page) actually goes into browser history, the first (final form state) fragment never makes it into browser history. Is there some easy way to do this?
Here’s an overview of what I’m trying which isn’t working (final form state fragment doesn’t go into browser history):
#form-0 (initial form state)
(user does some edits)
final form state stored as “form-1”
set fragment #form-1 <== No effect
add results components
set fragment #results-1
(browser now has only #form-0 and #results-1, not #form-1)
Any ideas how to add two browser history items in one event handling trip, or whether this is indeed the problem?
Using Vaadin 6.5.1.
Thank you!
Steve Harris