Just remember  in a simple valuesholder class the page id and pagmap
for a page (and version if you want that) and then ask through the
session for that page. If many pages (or big pages) are created in
between, it could return nothing.. Depending on the size of the
diskpage session/pagmap file.

On 1/21/08, Ned Collyer <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I may be overlooking something, however I am having a bit of trouble linking
> to the last current version of a page unless I use the method outlined by
> igor, which isn't practical for what I am trying to achieve (see his method
> below from
> http://www.nabble.com/pageMap-question---td13541168.html#a13554232)
>
>
> igor.vaynberg wrote:
> >
> > for scenarios like those simply pass the page instance to another page
> >
> > class secondsteppage extends webpage {
> >   public secondsteppage(page first) {
> >     add(new link("go-back") { onclick() { setresponsepage(first); }});
> >   }
> > }
> >
> > -igor
> >
>
> For example, say I have a page of search criteria (the form is in a reusable
> panel), and its filled and i navigate around a bit.  The next time I come to
> the search criteria page, I want it to remember the last search (ie, return
> the last version of the search criteria page).
>
> I have been able to do this in a rudimentary way by passing the page
> instance of the search criteria page through to the constructor of the
> destination page via a forms onSubmit().
>
> This means I can then call the
> setResponsePage(searchPage.getVersion(Page.LATEST_VERSION)); on the onClick
> of a link in the destination page.
>
> However this will only work from the destination page - not if i navigate
> around to other pages.  Without specifying a version  a new instance is
> being created.
>
>  (ie PageLink(SearchPage.class) creates a new SearchPage instance).
>
> Surely there is a way of retrieving the latest existing version of a page
> given a class type.  I've trawled google and the examples and api - I'm
> feeling stupid - like i've missed something obvious, or inadvertently broken
> the expected behaviour.
> --
> View this message in context:
> http://www.nabble.com/Link-to-last-version-of-a-page-of-a-given-type-class.-tp14994042p14994042.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]

Reply via email to