Discussion:
the back button behavior
christophe
2018-05-07 09:26:34 UTC
Permalink
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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Sven Meier
2018-05-07 17:56:51 UTC
Permalink
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
Post by christophe
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
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
--
http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
---------------------------------------------------------------------
christophe
2018-06-19 17:26:45 UTC
Permalink
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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Sven Meier
2018-06-19 21:09:02 UTC
Permalink
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
Post by 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 .
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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org

Loading...