You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Brown, Berlin [GCG-PFS]" <Be...@Primerica.com> on 2010/08/31 22:52:17 UTC

Dynamically invoke a page object (Reflection?)

What is the best approach to invoke a page object through the name of
the Page class.
 
E.g.
 
String pageStr = "com.test.Page";
 
Page page = new Wicket.createPageSomeHow(pageStr);
setResponsePage(page)
 
Is there a way to do something like this?
 
Berlin Brown

Re: Dynamically invoke a page object (Reflection?)

Posted by James Carman <ja...@carmanconsulting.com>.
What are you trying to do exactly?

On Tue, Aug 31, 2010 at 4:52 PM, Brown, Berlin [GCG-PFS]
<Be...@primerica.com> wrote:
> What is the best approach to invoke a page object through the name of
> the Page class.
>
> E.g.
>
> String pageStr = "com.test.Page";
>
> Page page = new Wicket.createPageSomeHow(pageStr);
> setResponsePage(page)
>
> Is there a way to do something like this?
>
> Berlin Brown
>

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


Re: Dynamically invoke a page object (Reflection?)

Posted by Arjun Dhar <dh...@yahoo.com>.
Use "setResponsePage(new<PageClassName>(params));"
params depends on the Constructor of the WebPage class extension.
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamically-invoke-a-page-object-Reflection-tp2402302p2403066.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: Dynamically invoke a page object (Reflection?)

Posted by "Brown, Berlin [GCG-PFS]" <Be...@Primerica.com>.
So, just use reflection.

OK.   I thought there might have been some Wicket oriented utility.  But
I am OK with reflection. 

-----Original Message-----
From: Wilhelmsen Tor Iver [mailto:TorIverW@arrive.no] 
Sent: Wednesday, September 01, 2010 4:03 AM
To: users@wicket.apache.org
Cc: Berlin Brown
Subject: SV: Dynamically invoke a page object (Reflection?)

> Page page = new Wicket.createPageSomeHow(pageStr);

Try reflection, e.g. Class.forName(pageStr).newInstance() for using a
parameterless constructor.

- Tor Iver

---------------------------------------------------------------------
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


SV: Dynamically invoke a page object (Reflection?)

Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
> Page page = new Wicket.createPageSomeHow(pageStr);

Try reflection, e.g. Class.forName(pageStr).newInstance() for using a parameterless constructor.

- Tor Iver

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