Yes, that is one way to solve this. Apparently I misunderstood the purpose of RestartResponseAtInterceptPageException. I guess it is meant for intercepting on situations like authorization (no other use case comes into my mind).
Thanks for your help.
/arto
2006/2/10, Igor Vaynberg <[EMAIL PROTECTED]>:
why not pass in a page reference into the properties page. that way you can just setResponsePage(backPage) in your back link handler.
-Igor
On 2/9/06, Arto Arffman <[EMAIL PROTECTED] > wrote:I'll explain the use case:There is a general properties page that is called from several other pages. User uses this just to see the properties of the object. And when the user has seen enough he wants to click the back button to continue what ever he was doing.OK, the properties page could have two constructor parameters, the object to show the properties for, and the page where back button should point to. But I just thought that this exception was designed to do exactly this use case - go somewhere and then come back. I suppose it works but only with submits./arto
2006/2/10, Johan Compagner <[EMAIL PROTECTED]>:What is the original page?
Really the page with the link on it?
So when you click a link on it your wnat to redirect and return to the page with the link on it?
Curious what the case would be for that.
i think you just need to use this class:
public RestartResponseException(Page page)
and then youre redirect page has a Constructor with a page param.
and in the onClick you set that page as the return page.
johan
On 2/9/06, Arto Arffman <[EMAIL PROTECTED] > wrote:Hi,I have a link that redirects to a page where should be a link back to the original page. I tried to use RestartResponseAtInterceptPageException to accomplish this.OriginalPage:public OriginalPage() {...add(new Link("link") {public void onClick() {throw new RestartResponseAtInterceptPageException(RedirectPage.class);}});...}RedirectPage:public RedirectPage() {...add(new Link("back") {public void onClick() {continueToOriginalDestination();}});...}But this does not work, because the url of original destination points to onClick handler, which redirect to RedirectPage again!I guess I should check this and not redirect if we getting back from RedirectPage. But how can the onClick handler detect this?/arto
