you can pass the master page instance into the detail page, then in
detail page simply go back
class masterpage extends webpage {
add(new link("detail") { onclick() { setresponsepage(new
detailpage(masterpage.this));}});
}
clas detailpage extends webpage {
public detailpage(final page back) {
add(new link("back") { oncick() { setresponsepage(back);}});
}
-igor
On Sun, Oct 19, 2008 at 9:04 AM, overseastars <[EMAIL PROTECTED]> wrote:
>
>
> Hi all
> I'm learning to use the library example on the wicket website. But I found
> that once I got some results by search and I clicked one link to go into
> that detail page, then I actually could go back to the previous page. The
> example on the wicket website just provides a link to home, not a real
> "Back" link.
>
> For example, I'm searching some hotels. I input a keyword in the search bar
> and then get a list of accommodations. Then I click on one record and I get
> a list of rooms of that accommodation. Now if I click on one room it will go
> to the detail page of that room. What if I want to go back to the previous
> page containing a list of rooms? Furthermore, what if I want to go back to
> that page including a list of accommodation??
>
> I just put a small piece of my code here. this is the method from the wicket
> example page. How can I make a "back" link?
> I really need this. otherwise my mentor will kill my marks......:-( Please
> help me. Many thanks~~
>
>
> public static BookmarkablePageLink link(final String name,
> final Accommodation accommodation) {
> clickedAccommodation = accommodation;
>
> final BookmarkablePageLink link = new
> BookmarkablePageLink(name,
> RoomResultListPage.class);
>
> if (accommodation != null) {
> link.setParameter("aid", accommodation.getAid());
>
> link.add(new Label("name", new
> Model(accommodation.getName())));
> } else {
> link.add(new Label("name", "No matched rooms -
> xingxing"));
> link.setEnabled(false);
> }
>
> return link;
>
> }
> --
> View this message in context:
> http://www.nabble.com/%22go-back%22-problem-tp20057504p20057504.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]