That is incorrect. You can pass data to your CoolPage regardless of the
setResponsePage() method signature. Just try implementing both and observe
the URL once you invoke both its signatures. One will be bookmarkable and
the other will not be but I'll leave it to you which signature is
bookmarkable. Once you have explored this, investigate PageParameters,
WebApplication's mountBookmarkablePage method then URL Coding strategies.

Oh, make sure you have either a default constructor or a constructor passing
in a PageParameters in your CoolPage before playing around with the
setResponsePage(Class pageClass) signature. ;-)

Best,
James.

On Wed, Dec 17, 2008 at 10:50 AM, HHB <[email protected]> wrote:

>
> We call setResponsePage(new CoolPage()) if want to pass some data to
> CoolPage
> and we call setResponsePage(CoolPage.class) if we only want to render
> CoolPage
> Am I right?
>
>
> HHB wrote:
> >
> > Hey,
> > What is the difference between:
> > setResponsePage(CoolPage.class)
> > and
> > setResponsePage(new CoolPage())
> > ?
> > When to use each one?
> > Thanks.
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/When-to-pass-object-instance--class-type--tp20998410p21050898.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]
>
>

Reply via email to