One way is using constructors. Pages are objects like every other.

so this way you create a link that will create a new page, and redirect to it:

class Page1 extends Page {
  public Page1() {
    add(new Link("link1") {
      public void onClick() {
        Page2 page = new Page2("Something", "here");
        setResponsePage(page);
      }
    });
  }
}

class Page2 extends Page {
   public Page2(String arg1, String arg2) {
     add(new Label("l1", arg1));
     add(new Label("l2", arg2));
   }
}

There might be typos in the examples ;)

-Matej

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