This can be done by multiply ways

First construct the Page for the link and use the
public PageLink(final String id, final Page page)
constructor

Then when that link is clicked that page is returned with all the state you inserted into it.
If you want to do lazy init use this constructor:

public PageLink(final String id, final IPageLink pageLink)

and a IPageLink implementation could look like this:

this.pageLink = new IPageLink()
       {
           public Page getPage()
           {
               return new MyPage(argument1,argument2);
           }

           public Class getPageIdentity()
           {
               return myPageClass;
           }
       };

that is how you can use PageLink to link pages with non bookmarkable links
Of course you can also use the bookmarkablepage link for yourr MyPage page..
Then give youre MyPage class a PageParameters constructor and use the BookmarkablePageLink:

   public BookmarkablePageLink(final String id, final Class pageClass,
           final PageParameters parameters)

The end result is all the same youre MyPage is displayed with the params you want. The begin result is a bit different when using PageLink or BookmarkablePageLink (the url looks different there is pushed a bit more state to the client)

johan

Gili wrote:

You are quite right but I am confused about a very fundamental thing here: how does one pass parameters between non-bookmarkable pages?

Thank you,
Gili

Johan Compagner wrote:
But if you add a PageParametes argument to the constructor of PageLink. Don't we then have a BookmarkablePageLink??
public PageLink(final String id, final Class c)
public BookmarkablePageLink(final String id, final Class pageClass,
           final PageParameters parameters)

johan


Gili wrote:


Looking at the implementation of PageLink, maybe we should be adding a new constructor that takes in a PageParameters argument and uses it when lazily-constructing the page? Can I open a RFE for this?

Gili

Gili wrote:

> Hi,
>
> I feel silly asking this... Say I have pages A and B. There are links from page A to B. Page A is passed an imageID by its PageParameters. I want Wicket to pass specific parameters when one clicks on the links to Page B.
>
> That is, how do I control what parameters are passed to page B when one clicks on the links to it? PageLink only takes the Page class, no arguments as far as I can tell.
>
>     Let me know.
>
> Thanks,
> Gili




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to