Do you use Eclipse?  There is a compiler warning that you can turn on (it
should be on by default) that warns against this problem whenever you
may inadvertently be "hiding" other variables.  I suggest to everyone I
teach that they turn it on (and perhaps even turn it up from warning to
error), and of course, stop ignoring the little yellow squiggly lines :)

On Sun, Oct 10, 2010 at 12:47 PM, Zeldor <> wrote:

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

Jeremy Thomerson

Reply via email to