You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by christophe <ma...@wanadoo.fr> on 2018/05/07 09:26:34 UTC
the back button behavior
Hello
My question/request is about the back button, or more to the point on how
Wicket processes it and how the default behavior can ve overridden
Let me explain the context of my question:
I am developping an application ( a web based patient record managment
design specifically for Africa).
Users (MDs, nurses..) open pages to look up/create or modify patients,
episodes of care, prescriptions....
I want to prevent any user from accessing (going back to) pages that were
previosuly displayed. There are many reasons for that.
What I currently do (an I am not too happy about the solution is
1) let wicket redisplay the "previous" page when the user clicks on the
broser back button
2) one displayed the page sends a message to the back end with its ID
(unique ID generated by the application)
3) if the ID is not the ID of the LAST page, the application redisplays the
last page (hence, overlaying th eprevious on)
It creates an awful lot of useless HTML traffic and it is ugly
Hence my question
Is there any way I can force wicket/my aplication to display the LAST page
anytime the user clicks on the browser's back button
Thank you very much
Christophe Montagne
--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: the back button behavior
Posted by Sven Meier <sv...@meiers.net>.
Hi,
you can register a listener in your application's init() and handle the
exception there:
getRequestCycleListeners().add(new AbstractRequestCycleListener() {
@Override
public IRequestHandler onException(RequestCycle cycle, Exception ex)
{
if (ex instanceof PageExpiredException) {
// handle exception
}
return null;
}
});
Have fun
Sven
Am 19.06.2018 um 19:26 schrieb christophe:
> Hello Sven
>
> First of all thank you very much for you very quick answer. And I do
> apologize for not responding earlier. I have been quite busy lately and
> perhaps distracted as well.
>
> I did as you recommended. In other words I implemented the class the link
> suggests and configured the application .
>
> IT works up to a certain point:
> When I clink on the browser back button, a "stale page" page is displayed.
> This is good as the "previous" page is not served by the application. THis
> is aht I want... Well almost...
> I have been unable to catech the exception not to find aly way to get Wicket
> to "redisplay" the page I want or at least let me indicate vi a
> seResponsePage what page I want it to display
>
> Can you help me with this please?
>
> Regards
>
> Christophe
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> 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: the back button behavior
Posted by christophe <ma...@wanadoo.fr>.
Hello Sven
First of all thank you very much for you very quick answer. And I do
apologize for not responding earlier. I have been quite busy lately and
perhaps distracted as well.
I did as you recommended. In other words I implemented the class the link
suggests and configured the application .
IT works up to a certain point:
When I clink on the browser back button, a "stale page" page is displayed.
This is good as the "previous" page is not served by the application. THis
is aht I want... Well almost...
I have been unable to catech the exception not to find aly way to get Wicket
to "redisplay" the page I want or at least let me indicate vi a
seResponsePage what page I want it to display
Can you help me with this please?
Regards
Christophe
--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: the back button behavior
Posted by Sven Meier <sv...@meiers.net>.
Hi,
have you tried disabling the page store:
http://maciej-miklas.blogspot.de/2013/09/wicket-6-disable-page-serialization.html
You can keep the pageId of the last page in the session and redirect to it if a request to an expired page comes in.
Have fun
Sven
Am 7. Mai 2018 11:26:34 MESZ schrieb christophe <ma...@wanadoo.fr>:
>Hello
>
>My question/request is about the back button, or more to the point on
>how
>Wicket processes it and how the default behavior can ve overridden
>
>Let me explain the context of my question:
>I am developping an application ( a web based patient record managment
>design specifically for Africa).
>Users (MDs, nurses..) open pages to look up/create or modify patients,
>episodes of care, prescriptions....
>I want to prevent any user from accessing (going back to) pages that
>were
>previosuly displayed. There are many reasons for that.
>What I currently do (an I am not too happy about the solution is
>1) let wicket redisplay the "previous" page when the user clicks on
>the
>broser back button
>2) one displayed the page sends a message to the back end with its ID
>(unique ID generated by the application)
>3) if the ID is not the ID of the LAST page, the application redisplays
>the
>last page (hence, overlaying th eprevious on)
>
>It creates an awful lot of useless HTML traffic and it is ugly
>
>Hence my question
>Is there any way I can force wicket/my aplication to display the LAST
>page
>anytime the user clicks on the browser's back button
>
>Thank you very much
>
>Christophe Montagne
>
>--
>Sent from:
>http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>For additional commands, e-mail: users-help@wicket.apache.org