You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Cristi Manole <cr...@gmail.com> on 2008/06/26 10:07:19 UTC

Panel switching and back button

Hello,

I am implementing navigation through my application by switching panels.

When the user presses the back button, I'd like to show the previously
displayed panel. Is this possible?

Thanks,
Cristi Manole

Re: Panel switching and back button

Posted by Cristi Manole <cr...@gmail.com>.
will try that. tks

On Thu, Jun 26, 2008 at 4:16 PM, Thomas Mäder <to...@gmail.com> wrote:

> Hmhhh... isn't there a Javascript function which allows to replace the URL
> of the current page in the history? I'm not sure this would work, but
> couldn't you try this:
>
> 1) replace the panel
> 2) reload the IFrame
> 3) now manipulate the browser history to point to the currect URL for the
> current page version
>
> Thomas
>
> On Thu, Jun 26, 2008 at 3:08 PM, Cristi Manole <cr...@gmail.com>
> wrote:
>
> > yes, I know, I'm trying to figure out a solution myself.
> >
> > I was sure though somebody else ran into this. :)
> >
> > On Thu, Jun 26, 2008 at 3:28 PM, Thomas Mäder <to...@gmail.com>
> > wrote:
> >
> > > Aha, the problem is that ajax does not cause a history entry to be
> > created.
> > > I've seen workarounds for this (not with wicket, though) which reload a
> > > hidden IFrame each time they make a relevant change. I can't see right
> > now
> > > how that helps you in wicket, tough.
> > >
> > > Thomas
> > >
> > >
> > > On Thu, Jun 26, 2008 at 1:56 PM, Cristi Manole <cristimanole@gmail.com
> >
> > > wrote:
> > >
> > > > yes, with Ajax
> > > >
> > > > On Thu, Jun 26, 2008 at 2:15 PM, Thomas Mäder <tomlist0408@gmail.com
> >
> > > > wrote:
> > > >
> > > > > I would expect that to happen by default. Replacing a panel should
> > > create
> > > > a
> > > > > new page version which should change the Page URL. Are you using
> > AJAX?
> > > > >
> > > > > Thomas
> > > > >
> > > > > On Thu, Jun 26, 2008 at 10:07 AM, Cristi Manole <
> > > cristimanole@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Hello,
> > > > > >
> > > > > > I am implementing navigation through my application by switching
> > > > panels.
> > > > > >
> > > > > > When the user presses the back button, I'd like to show the
> > > previously
> > > > > > displayed panel. Is this possible?
> > > > > >
> > > > > > Thanks,
> > > > > > Cristi Manole
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Panel switching and back button

Posted by Thomas Mäder <to...@gmail.com>.
Hmhhh... isn't there a Javascript function which allows to replace the URL
of the current page in the history? I'm not sure this would work, but
couldn't you try this:

1) replace the panel
2) reload the IFrame
3) now manipulate the browser history to point to the currect URL for the
current page version

Thomas

On Thu, Jun 26, 2008 at 3:08 PM, Cristi Manole <cr...@gmail.com>
wrote:

> yes, I know, I'm trying to figure out a solution myself.
>
> I was sure though somebody else ran into this. :)
>
> On Thu, Jun 26, 2008 at 3:28 PM, Thomas Mäder <to...@gmail.com>
> wrote:
>
> > Aha, the problem is that ajax does not cause a history entry to be
> created.
> > I've seen workarounds for this (not with wicket, though) which reload a
> > hidden IFrame each time they make a relevant change. I can't see right
> now
> > how that helps you in wicket, tough.
> >
> > Thomas
> >
> >
> > On Thu, Jun 26, 2008 at 1:56 PM, Cristi Manole <cr...@gmail.com>
> > wrote:
> >
> > > yes, with Ajax
> > >
> > > On Thu, Jun 26, 2008 at 2:15 PM, Thomas Mäder <to...@gmail.com>
> > > wrote:
> > >
> > > > I would expect that to happen by default. Replacing a panel should
> > create
> > > a
> > > > new page version which should change the Page URL. Are you using
> AJAX?
> > > >
> > > > Thomas
> > > >
> > > > On Thu, Jun 26, 2008 at 10:07 AM, Cristi Manole <
> > cristimanole@gmail.com>
> > > > wrote:
> > > >
> > > > > Hello,
> > > > >
> > > > > I am implementing navigation through my application by switching
> > > panels.
> > > > >
> > > > > When the user presses the back button, I'd like to show the
> > previously
> > > > > displayed panel. Is this possible?
> > > > >
> > > > > Thanks,
> > > > > Cristi Manole
> > > > >
> > > >
> > >
> >
>

Re: Panel switching and back button

Posted by Martin Grigorov <mc...@e-card.bg>.
We use ReallySimpleHistory
(http://code.google.com/p/reallysimplehistory/) for this. Every AjaxLink
(or component+AjaxEventBehavior) records the url of the current page +
some indicator in the hash path (e.g. '../blah/page#someId') in rsh.js
(via AjaxCallDecorator).

Later when the user presses 'back button' the request is to the same
page with the id in the hash. Then 'onload' JS function checks the
location.hash and if it is nonEmpty it makes something like this:

Wicket.$('someId').click()

and this actually calls the behavior which will set the page's state
back to the previous one.

this works only for ajax "navigation". The models behind are always the
latest version.
If you need the previous version of the models then you need to create a
new version of the page on every Ajax request too. But this is getting
complex.

On Thu, 2008-06-26 at 16:08 +0300, Cristi Manole wrote:
> yes, I know, I'm trying to figure out a solution myself.
> 
> I was sure though somebody else ran into this. :)
> 
> On Thu, Jun 26, 2008 at 3:28 PM, Thomas Mäder <to...@gmail.com> wrote:
> 
> > Aha, the problem is that ajax does not cause a history entry to be created.
> > I've seen workarounds for this (not with wicket, though) which reload a
> > hidden IFrame each time they make a relevant change. I can't see right now
> > how that helps you in wicket, tough.
> >
> > Thomas
> >
> >
> > On Thu, Jun 26, 2008 at 1:56 PM, Cristi Manole <cr...@gmail.com>
> > wrote:
> >
> > > yes, with Ajax
> > >
> > > On Thu, Jun 26, 2008 at 2:15 PM, Thomas Mäder <to...@gmail.com>
> > > wrote:
> > >
> > > > I would expect that to happen by default. Replacing a panel should
> > create
> > > a
> > > > new page version which should change the Page URL. Are you using AJAX?
> > > >
> > > > Thomas
> > > >
> > > > On Thu, Jun 26, 2008 at 10:07 AM, Cristi Manole <
> > cristimanole@gmail.com>
> > > > wrote:
> > > >
> > > > > Hello,
> > > > >
> > > > > I am implementing navigation through my application by switching
> > > panels.
> > > > >
> > > > > When the user presses the back button, I'd like to show the
> > previously
> > > > > displayed panel. Is this possible?
> > > > >
> > > > > Thanks,
> > > > > Cristi Manole
> > > > >
> > > >
> > >
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Panel switching and back button

Posted by Cristi Manole <cr...@gmail.com>.
yes, I know, I'm trying to figure out a solution myself.

I was sure though somebody else ran into this. :)

On Thu, Jun 26, 2008 at 3:28 PM, Thomas Mäder <to...@gmail.com> wrote:

> Aha, the problem is that ajax does not cause a history entry to be created.
> I've seen workarounds for this (not with wicket, though) which reload a
> hidden IFrame each time they make a relevant change. I can't see right now
> how that helps you in wicket, tough.
>
> Thomas
>
>
> On Thu, Jun 26, 2008 at 1:56 PM, Cristi Manole <cr...@gmail.com>
> wrote:
>
> > yes, with Ajax
> >
> > On Thu, Jun 26, 2008 at 2:15 PM, Thomas Mäder <to...@gmail.com>
> > wrote:
> >
> > > I would expect that to happen by default. Replacing a panel should
> create
> > a
> > > new page version which should change the Page URL. Are you using AJAX?
> > >
> > > Thomas
> > >
> > > On Thu, Jun 26, 2008 at 10:07 AM, Cristi Manole <
> cristimanole@gmail.com>
> > > wrote:
> > >
> > > > Hello,
> > > >
> > > > I am implementing navigation through my application by switching
> > panels.
> > > >
> > > > When the user presses the back button, I'd like to show the
> previously
> > > > displayed panel. Is this possible?
> > > >
> > > > Thanks,
> > > > Cristi Manole
> > > >
> > >
> >
>

Re: Panel switching and back button

Posted by Thomas Mäder <to...@gmail.com>.
Aha, the problem is that ajax does not cause a history entry to be created.
I've seen workarounds for this (not with wicket, though) which reload a
hidden IFrame each time they make a relevant change. I can't see right now
how that helps you in wicket, tough.

Thomas


On Thu, Jun 26, 2008 at 1:56 PM, Cristi Manole <cr...@gmail.com>
wrote:

> yes, with Ajax
>
> On Thu, Jun 26, 2008 at 2:15 PM, Thomas Mäder <to...@gmail.com>
> wrote:
>
> > I would expect that to happen by default. Replacing a panel should create
> a
> > new page version which should change the Page URL. Are you using AJAX?
> >
> > Thomas
> >
> > On Thu, Jun 26, 2008 at 10:07 AM, Cristi Manole <cr...@gmail.com>
> > wrote:
> >
> > > Hello,
> > >
> > > I am implementing navigation through my application by switching
> panels.
> > >
> > > When the user presses the back button, I'd like to show the previously
> > > displayed panel. Is this possible?
> > >
> > > Thanks,
> > > Cristi Manole
> > >
> >
>

Re: Panel switching and back button

Posted by Cristi Manole <cr...@gmail.com>.
yes, with Ajax

On Thu, Jun 26, 2008 at 2:15 PM, Thomas Mäder <to...@gmail.com> wrote:

> I would expect that to happen by default. Replacing a panel should create a
> new page version which should change the Page URL. Are you using AJAX?
>
> Thomas
>
> On Thu, Jun 26, 2008 at 10:07 AM, Cristi Manole <cr...@gmail.com>
> wrote:
>
> > Hello,
> >
> > I am implementing navigation through my application by switching panels.
> >
> > When the user presses the back button, I'd like to show the previously
> > displayed panel. Is this possible?
> >
> > Thanks,
> > Cristi Manole
> >
>

Re: Panel switching and back button

Posted by Thomas Mäder <to...@gmail.com>.
I would expect that to happen by default. Replacing a panel should create a
new page version which should change the Page URL. Are you using AJAX?

Thomas

On Thu, Jun 26, 2008 at 10:07 AM, Cristi Manole <cr...@gmail.com>
wrote:

> Hello,
>
> I am implementing navigation through my application by switching panels.
>
> When the user presses the back button, I'd like to show the previously
> displayed panel. Is this possible?
>
> Thanks,
> Cristi Manole
>