Reputation: 223
In my Wicket application I have a page refresh problem. If a user clicks on f5 on certain pages, the application will act unexpectedly.
Most object are refreshed to their original status. For example, a button that changed from 'send' to 'finish' after sending data (Javascript), would be restored to 'send'. However, some cached content is not cleared. Clicking the button of the previous example would act as a 'finish' button, and not as a 'send' button.
What I would like, is to refresh everything if a user presses f5 (like ctrl-f5?), so its like the user hasn't done anything on the page yet. Is this possible with Javascript?
Thanks!
Upvotes: 0
Views: 392
Reputation: 10896
No, it's not possible with javascript (at least not without a large dose of black magic). To retain the current state of the page, this state must reside on the server. That is, changing the label from 'send' to 'finish' on the server (wicket components), while handling the submit event. If you just do it just with javascript, the server won't know about the change, so it can't restore it appropriately.
Upvotes: 2