lse could seem longer than reflection, but in the case of
> reflection you need to write 50+ properties.
>
--
View this message in context:
http://www.nabble.com/Calling-Methods-based-on-page-parameters-tf4448115.html#a12725909
Sent from the Wicket - User mailing list a
--
View this message in context:
http://www.nabble.com/Calling-Methods-based-on-page-parameters-tf4448115.html#a12711488
Sent from the Wicket - User mailing list archive at Nabble.com.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Hi,
If you use if or switch, put at the top the most used.
Using if/else could seem longer than reflection, but in the case of reflection
you need to write 50+ properties.
Regards.
darrengreer wrote:
I'm going to give it a go with the switch statement, thanks to both of you.
I'll let you kno
I'm going to give it a go with the switch statement, thanks to both of you.
I'll let you know how it goes.
Of course, if you can just use numbers, then you can just use
switch()...
/Gwyn
--
View this message in context:
http://www.nabble.com/Calling-Methods-based-on-page-
My expectation would be that it wouldn't be significant/noticeable,
but it should be easy enough to knock up a test to confirm and
quantify that...
Of course, if you can just use numbers, then you can just use
switch()...
/Gwyn
On Sunday, September 16, 2007, 1:01:02 PM, darrengreer <[EMAIL PROTE
a list of if/else
>if ("up".equals(panelType)) {
> return new UserPanel(id);
>}
>if( "xx".equals(panelType)) {
> ...
>}
>
--
View this message in context:
http://www.nabble.com/Calling-Methods-based-on-page-parameters-tf4448115.
Hi,
First I suggest you to create a factory class in charge of converting string to
instance :
Panel MyFactory.newComponent(String panelType, String id);
To implement the method, I see 2 ways:
1/ a list of if/else
if ("up".equals(panelType)) {
return new UserPanel(id);
}
if( "xx".equ
could point me in the right
direction, or explain to me how much easier this is to do using some wicket
feature I haven't figure out yet.
--
View this message in context:
http://www.nabble.com/Calling-Methods-based-on-page-parameters-tf4448115.html#a1