You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Paolo Di Tommaso <pa...@gmail.com> on 2008/12/10 23:18:30 UTC
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
Posted by Paolo Di Tommaso <pa...@gmail.com>.
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 <ig...@gmail.com>wrote:
> 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
> <pa...@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 <ma...@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
> >> <pa...@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-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Wicket session back button support
Posted by Igor Vaynberg <ig...@gmail.com>.
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
<pa...@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 <ma...@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
>> <pa...@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-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket session back button support
Posted by Paolo Di Tommaso <pa...@gmail.com>.
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 <ma...@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
> <pa...@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Wicket session back button support
Posted by Matej Knopp <ma...@gmail.com>.
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
<pa...@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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org