if the page wants to be bookmarkable and accepts no params all it needs is a default constructor.
if the page wants to be bookmarkable and accept params off url it needs to implement the Page(PageParameters params) constructor.
in order for the link to show up as bookmarkable you have to use the setResponsePage(Class) or setResponsePage(Class,PageParameters) variants.
then there is page mounting which is new in 1.2. this allows you to mount a bookmarkable page onto a certain url.
so you can say WebApplication.mount("/orders/view", ViewPage.class);
and then your page becomes accessible through /orders/view url
the default encoding parameter scheme for bookmarkable pages is thus
/parameter/value/parameter/value/...
so if you want a url to view a certain order it would be
/orders/view/order/10232 where order would be the name of the param you can retrieve from pageparameters.
-Igor
On 1/20/06, Rosenstrauch, David <[EMAIL PROTECTED]> wrote:
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Igor Vaynberg
Sent: Friday, January 20, 2006 5:18 PM
To: [email protected]
Subject: Re: [Wicket-user] Another noob questionuse the good old java constructors
class Page2 extends WebPage {
public Page2(PurchaseOrder order) {
...
}
}
onsubmit() {
PurcharOrder o=getPurchaseOrder();
setResponsePage(new Page2(o));
}
this has the benefit of strong typing and simplicity over using the pageparams object to pass in the values. the pageparams constructor is used for bookmarkable pages where the parameters come from a url. its not meant to be used when page transitions are internal to wicket, for that the cosntructor params are a much better choice.
at the end its just java. your page is an ordinary object, you can pass the data in any way you want, its up to you.
-Igor
[Rosenstrauch, David]OK. Got that part.One last (really!) question, though:Bookmarking was what I was also trying to achieve here.Say that page 2 is the "display purchase order" page, and it's bookmarkable in its own right, as long as you pass in a parameter "orderId=1234"?How is it possible to make the results page bookmarkable to be called later? The URL I see in the browser includes "?path=1", and does not include the orderId parameter, so it doesn't appear to be bookmarkable.Thanks again very much for all the help.DR==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================
