It does! Thanks a lot! I knew it was something stupid and trivial. Huh, but it should not cause that still - I was defining TextFields in same way and then again to add parameters and it went fine.
On Sun, Oct 10, 2010 at 7:11 PM, Andrea Del Bene [via Apache Wicket] < [email protected]<ml-node%[email protected]> > wrote: > Hello Zeldor, > > I've red your code and it seems that you define variable rc two times: > the first time as form private field and the second time just below > between braces. When onSubmit method calls rc.getModelObject() it uses > private field rc which was not initialized and so triggers a > NullPointerException. Try to remove the second type definition > "RadioChoice<String>" and it should work. > > > public class Registration extends WebPage { > > public Registration() { > > add(new FeedbackPanel("errorMsg")); > > //New user registration form > > Form<String> regForm = new > > Form<String>("registrationForm",new Model<String>()) { > > static final List<String> NUMBERS = > > Arrays.asList(new String[] { "1", "2", "3" }); > > > > private RadioChoice<String> rc; > > > > { > > RadioChoice<String> rc = new > > RadioChoice<String>("numberRadioChoice", new > > Model<String>(""),NUMBERS).setSuffix(""); > > add(rc.setRequired(true)); > > } > > > > @Override > > public void onSubmit() { > > String _numbers = rc.getModelObject(); > > System.out.println(_numbers); > > } > > }; > > add(regForm); > > } > > } > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden > email]<http://user/SendEmail.jtp?type=node&node=2970427&i=0> > For additional commands, e-mail: [hidden > email]<http://user/SendEmail.jtp?type=node&node=2970427&i=1> > > > > ------------------------------ > View message @ > http://apache-wicket.1842946.n4.nabble.com/RadioChoice-what-s-wrong-tp2967576p2970427.html > To unsubscribe from RadioChoice - what's wrong?, click > here<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=2967576&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwyOTY3NTc2fC0xMTUwMjA4NDM=>. > > > -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioChoice-what-s-wrong-tp2967576p2970465.html Sent from the Users forum mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
