This is going to cause you problem with multiple windows. You should 
rather obtain the pagemap using Page#getPageMap.

Anyway, this doesn't feel like the right way to get to previous page. 
Can't you just propagate the page instance and then use 
setResponsePage(previousPageInstance) where appropriate?

-Matej

Ronald Dekker wrote:
> Hi all,
> 
> We're using the following code to populate a link to the previous page 
> (mimicking the back button, as it were):
> 
>                       private Page getPreviousPage() {
>                               PageMap defaultPageMap = 
> getSession().getDefaultPageMap();
>                               ArrayListStack accessStack = 
> defaultPageMap.getAccessStack();
>                               PageMap.Access access = (Access) 
> accessStack.get(accessStack.size()-2);
>                               Page page = 
> defaultPageMap.getEntry(access.getId()).getPage();
>                               return page;
>                       }
> 
> Is this really the neatest/cleanest way of doing this in Wicket? We'd kind of 
> expected a convenience method like "getSession().getPreviousPage()".
> 
> Cheers,
> Ronald & Joris
> 
> Developement Team
> Huygens Institute - KNAW
> The Hague - The Netherlands
> 
> 
> 
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> 



_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to