Re: When to pass object instance /class type?

2008-12-17 Thread francisco treacy
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  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-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: When to pass object instance /class type?

2008-12-17 Thread James Perry
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  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-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: When to pass object instance /class type?

2008-12-17 Thread HHB

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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



When to pass object instance /class type?

2008-12-14 Thread HHB

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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org