|
Link has been edited by Confluence Administrator (Oct 17, 2006). Change summary: Content:ScopeThis page describes the use of the Link BackgroundFAQExamplesTo pass your own objects from one page to another as part of link, just use {{setResponsePage}}as below, i.e. passing in a instance of the new page created with your custom constructor. (The example also shows how the 'Edit' page can return to the instance of the 'List' page once editing is complete.) class ListUsersPage extends Webpage { ..... add(new Link("edit") { onclick() { setResponsePage(new EditUserPage( ListUsersPage.this, (User)getModelObject())); } } class EditUserPage extends WebPage { public EditUserPage(final WebPage backPage, User user) { Form form; add(form=new Form("form", )); form.add(new Button("save") { onsubmit() { //save user setResponsePage(backPage); <=== navigates to the list users page in its previous state });}} [From a posting of Igor's to the wicket-user list - Gwyn |
Unsubscribe or edit your notifications preferences
