You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by HHB <hu...@yahoo.ca> on 2008/12/14 09:58:29 UTC

When to pass object instance /class type?

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--tp20998410p20998410.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: When to pass object instance /class type?

Posted by francisco treacy <fr...@gmail.com>.
have a look at http://cwiki.apache.org/WICKET/bookmarkable-pages-and-links.html
, it could help you understand the difference.

francisco


On Sun, Dec 14, 2008 at 9:58 AM, HHB <hu...@yahoo.ca> 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--tp20998410p20998410.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: When to pass object instance /class type?

Posted by James Perry <ja...@gmail.com>.
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 <hu...@yahoo.ca> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: When to pass object instance /class type?

Posted by HHB <hu...@yahoo.ca>.
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org