Nov 19th, 2009, 08:20 AM
[SWF2] Altering snapshot data prior to redisplaying page
There are occasions where we would not want to display all the data the user entered on a page when they return to that page via the browser back (or forward) button, e.g. sensitive data.
What is the best approach, if it's even possible, to intercepting retrieved snapshot data and altering it prior to rendering the page.
Nov 20th, 2009, 12:19 PM
I think you would need to dig into the guts of SWF to do this. Any reason why you can't just discard the snapshot or invalidate the history?
Nov 25th, 2009, 07:58 AM
Basically, I want the user to be able to go back and change data, but some data is sensitive and so should not be redisplayed - normally our applications have application Back buttons and we trap the use of the browser back button to prevent its use; so we control what gets re-rendered on the form when the user goes back. This application has never had an app back button anyway and the client wants users to be able to use the browser back button in the next release.
I have a possible solution whereby the content of the form is copied to a second object in flowscope and the sensitive data is removed from the form. This is done whilst still in the view-state, before the snapshot is saved. The snapshot seems to get its data from the form and not the request, so when it gets saved on leaving view-state, the sensitive data is not saved with it. Not particularly elegant, but should only be required for one or two pages.
Whilst looking at this I've also been wondering about the usefulness of history=discard for a single page. If it meant when you used the back button you just skipped over that page to the prior page it would be great, but you get an exception which seems to defeat the point somewhat - unless I'm missing something.
Tags for this Thread