Re: Wicket session back button support
Good, in this way it works. I'm apply the onBeforeRender trick to propagate the previous state in the session. Thank guys, long live to Wicket Paolo On Thu, Dec 11, 2008 at 6:27 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: or instead of pages use panels as content. that way you use the same menu instance across multiple pages and the menu can keep its own state. -igor On Thu, Dec 11, 2008 at 2:37 AM, Paolo Di Tommaso paolo.ditomm...@gmail.com wrote: Nice question. Consider the following use case: You have the main application menu bar. The user chooses an item from it. What happens is that all the following pages will be related to that choice, for example the second level menu in the page (that is contextual to the above choice) and I would avoid to specify it as a parameter every time I create a new page . Possible solution, store those variables in the page also and initialize them taking the values from the session. When the user clicks on the back button re-sync the session variables - if changed - overriding the onBeforeRender() method. Other solution could be to create a custom UrlEncodingStrategy to propagate the session vars on URL ... What do you think ? -- Paolo On Thu, Dec 11, 2008 at 12:29 AM, Matej Knopp matej.kn...@gmail.com wrote: No. You have to track the changes yourself. Or use Page as the scope. What's the reason to put values in session anyway? -Matej On Wed, Dec 10, 2008 at 11:18 PM, Paolo Di Tommaso paolo.ditomm...@gmail.com wrote: Dear community, I'm facing with a really ugly problem. In my web app I need to store some variables in the Wicket session. But this cause some nasty side-effects when users click on the browser back button. The page displays the previous content correctly but some components, which model is based on session values, do not. Is there any best practice for Wicket session to support the browser back button (so that coming back the session is restored to the previous state)? Thank you, Paolo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket session back button support
Nice question. Consider the following use case: You have the main application menu bar. The user chooses an item from it. What happens is that all the following pages will be related to that choice, for example the second level menu in the page (that is contextual to the above choice) and I would avoid to specify it as a parameter every time I create a new page . Possible solution, store those variables in the page also and initialize them taking the values from the session. When the user clicks on the back button re-sync the session variables - if changed - overriding the onBeforeRender() method. Other solution could be to create a custom UrlEncodingStrategy to propagate the session vars on URL ... What do you think ? -- Paolo On Thu, Dec 11, 2008 at 12:29 AM, Matej Knopp [EMAIL PROTECTED] wrote: No. You have to track the changes yourself. Or use Page as the scope. What's the reason to put values in session anyway? -Matej On Wed, Dec 10, 2008 at 11:18 PM, Paolo Di Tommaso [EMAIL PROTECTED] wrote: Dear community, I'm facing with a really ugly problem. In my web app I need to store some variables in the Wicket session. But this cause some nasty side-effects when users click on the browser back button. The page displays the previous content correctly but some components, which model is based on session values, do not. Is there any best practice for Wicket session to support the browser back button (so that coming back the session is restored to the previous state)? Thank you, Paolo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket session back button support
or instead of pages use panels as content. that way you use the same menu instance across multiple pages and the menu can keep its own state. -igor On Thu, Dec 11, 2008 at 2:37 AM, Paolo Di Tommaso paolo.ditomm...@gmail.com wrote: Nice question. Consider the following use case: You have the main application menu bar. The user chooses an item from it. What happens is that all the following pages will be related to that choice, for example the second level menu in the page (that is contextual to the above choice) and I would avoid to specify it as a parameter every time I create a new page . Possible solution, store those variables in the page also and initialize them taking the values from the session. When the user clicks on the back button re-sync the session variables - if changed - overriding the onBeforeRender() method. Other solution could be to create a custom UrlEncodingStrategy to propagate the session vars on URL ... What do you think ? -- Paolo On Thu, Dec 11, 2008 at 12:29 AM, Matej Knopp matej.kn...@gmail.com wrote: No. You have to track the changes yourself. Or use Page as the scope. What's the reason to put values in session anyway? -Matej On Wed, Dec 10, 2008 at 11:18 PM, Paolo Di Tommaso paolo.ditomm...@gmail.com wrote: Dear community, I'm facing with a really ugly problem. In my web app I need to store some variables in the Wicket session. But this cause some nasty side-effects when users click on the browser back button. The page displays the previous content correctly but some components, which model is based on session values, do not. Is there any best practice for Wicket session to support the browser back button (so that coming back the session is restored to the previous state)? Thank you, Paolo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket session back button support
Dear community, I'm facing with a really ugly problem. In my web app I need to store some variables in the Wicket session. But this cause some nasty side-effects when users click on the browser back button. The page displays the previous content correctly but some components, which model is based on session values, do not. Is there any best practice for Wicket session to support the browser back button (so that coming back the session is restored to the previous state)? Thank you, Paolo
Re: Wicket session back button support
No. You have to track the changes yourself. Or use Page as the scope. What's the reason to put values in session anyway? -Matej On Wed, Dec 10, 2008 at 11:18 PM, Paolo Di Tommaso [EMAIL PROTECTED] wrote: Dear community, I'm facing with a really ugly problem. In my web app I need to store some variables in the Wicket session. But this cause some nasty side-effects when users click on the browser back button. The page displays the previous content correctly but some components, which model is based on session values, do not. Is there any best practice for Wicket session to support the browser back button (so that coming back the session is restored to the previous state)? Thank you, Paolo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]