Thanks to all. Here is what I ended up with, that is working well:
Factory Class:
public static Panel newComponent(int moduleId, String id) {
switch (moduleId) {
case 1: return new UserPanel(id);
case 2: return new SignInPanel(id);
default: return new UserPanel(id);
}
}
BasePage:
String module = parameters.getString("m");
System.out.println("Module: " + module);
if (module==null) { module = "999"; }
try {
Panel contentPanel =
PanelFactory.newComponent(Integer.parseInt(module),
"contentPanel");
add(contentPanel);
} catch(Exception e) {
System.out.println(e);
}
--
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]
For additional commands, e-mail: [EMAIL PROTECTED]