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]
>
>

Reply via email to