class MyPage extends WebPage {
    public MyPage(Page returnTo) {
        add(new PageLink("terug", returnTo));
    }
}

works like a charm!

Martijn


On 6/14/06, Ronald Dekker <[EMAIL PROTECTED]> 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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



--
Download Wicket 1.2 now! Write Ajax applications without touching _javascript_!
-- http://wicketframework.org
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to