Thanks Johan for your time and support,
I tried to override onBeforeRequest(), just to test - the first call to
onBeforeRender suceeds but any furter call will throw and should redirect to
some page, but the redirect doesn't work. Wicket doesn't do anything special on
AbortException. The result is similar to removing the page from page map.
I prefer something like:
onRedirect() {setRresponsePage(Homepage.class);}
Thanks Jan
My test code:
private boolean doThrow;
@Override
protected void onBeforeRender() {
if(doThrow) {
RequestCycle.get().setRequestTarget(new PageRequestTarget(new HomePage()));
throw new AbortException();
}
super.onBeforeRender();
doThrow = true;
}
"Johan Compagner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
first of all no-cache will not result in a get request to the server again.
That will only happen if you add "no-store" to the configureResponse param
of the WebPage.
i thought that onRedirect() didn't even get called , dummy method (it doesn't
do anything). But it seems to be called i see.
We could make it none final, but all our event methods are final and redirect
to something else.
We first have to discuss why it is in the current state.
But you can override onBeginRender of the page. And then throw an
AbortException (RestartResponseAtInterceptPageException)
johan
On 12/15/06, jan_bar <[EMAIL PROTECTED]> wrote:
Thanks Johan,
I was a little big unclear. By default the HTML pages returned from wicket
has no-cache, so the back button usually posts request to server. When the
previous page url is RedirectPageRequestTarget, the page instance is found in
page map and rendered again. Why is the Page.onRedirect() method final? If this
method is not final, I can override it, check internal state and decide to call
setResponsePage(some other page).
Sample:
To create an order, user has to go through several pages of order build
wizard. On the final page he submits the order. At this time the order is
removed from session. When the user presses "Back", the previous page cannot
render, because there is no order, user has to start at the first page of the
wizard.
Jan
"Johan Compagner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL
PROTECTED] ...
When a user presses "Back" in a browser the page doesn't render again at
least
not in the serverside. By default it is a puur client side thing. (you
can configure
the page in configureResponse to always go back to the server when a user
hits back)
So what gets throwed at what time?
On 12/14/06, jan_bar <[EMAIL PROTECTED] > wrote:
Hi,
I have a not bookmarkable page (page with a form), when user clicks a
link
("submit"), the model data are cleared and confirmation page is
displayed.
Now, when the user pressed "Back" in browser, the page renders again,
but
because the model changed, it throws.
I want to be able to detect, when the old page is again requested and
redirect user to another page. But I don't know how the handle it, I
suppose
that calling setResponsePage during rendering phase is too late.
Another solution is to remove the page from page map, but it is not
nice,
because the user will see error page.
Thank you, Jan
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
--------------------------------------------------------------------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--------------------------------------------------------------------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------------------------------------------------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
------------------------------------------------------------------------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user