1

I'm developing a rich internet application, which is built using Wicket and a lot of fancy Wicket-JS integrations.

I'm now at the point that I want to store some user-settings; for example I have a TabbedPanel. I would like to be able to return the user to his most recently used tab if the user gets back to the page containing that TabbedPanel.

What would be the Wicket-way to store these user settings? I prefer not to store them on the server, but rather on the client..

Rob Audenaerde
  • 19,195
  • 10
  • 76
  • 121

2 Answers2

2

There is nothing in Wicket that would make this automatically for you.

One way is to put the settings in a Cookie (CookieUtils will help you a bit here). Another way is to store the settings in the browser's storage (localStorage or sessionStorage).

The benefit in using the cookie is that the settings will be available at the server side without any extra requests, so you can render the TabbedPanel with the pre-selected tab at first page render.

If you decide to use the storage then you'll have to write some JavaScript that will switch from the first tab to the saved tab on page load/domready. But the user experience won't be the best this way because the user will see how the tab content changes.

martin-g
  • 17,243
  • 2
  • 23
  • 35
1

I think you need to use cookies or, as alternative, you might store user settings into session. But in this later case user settings will be lost when session will expire or when user will log out. Component ModalWindow uses cookies to store similar data such as window dimensions or to remember window position .

Andrea Del Bene
  • 2,521
  • 1
  • 15
  • 20
  • Sorry Andrea your answer is really similar to martin-g's and equally helpful. I would have gladly accepted both, but unfortunately, I can't :/ – Rob Audenaerde Mar 27 '15 at 10:22