Hello Wayne,

I understand your frustration. Recently, I got a similar case but it eventually 
turned out that it was my fault due to being new in Wicket. Long story short, 
for a dropdownchoice list with loadabledetachablemodel, I set up a load method, 
but in another place, I used dropdownchoice#setChoices to update the list for 
ajax update. This method actually changes the model, but i did not know about 
its impact. I spent almost a whole day to figure out why the load method did 
not get called again.

So in your case, there MUST be a reason. Look everywhere these fields get 
changed. 

Good luck!
David


--- On Tue, 4/6/10, nino martinez wael <nino.martinez.w...@gmail.com> wrote:

> From: nino martinez wael <nino.martinez.w...@gmail.com>
> Subject: Re: Properties of model are set to NULL even though we have  
> setRequired set to true
> To: users@wicket.apache.org
> Date: Tuesday, April 6, 2010, 9:51 AM
> Hi Wayne
> 
> I guess you've tried debugging it, so it's not a consistent
> error? Are
> you using any special web container or is wrapped somehow
> (like
> terracotta)?
> 
> 2010/4/6 Wayne Pope <waynemailingli...@googlemail.com>:
> > Hi,
> >
> > has anyone got any idea about this? I'm still
> 'spinning my wheels' on it.
> >
> > thanks for any help.
> >
> > On Fri, Apr 2, 2010 at 5:00 PM, Wayne Pope
> > <waynemailingli...@googlemail.com>
> wrote:
> >> Hi,
> >>
> >> we've got several examples in our logs of
> properties of the model
> >> being set to null even though the textfield is set
> to required.
> >> I have NO idea how on earth this can happen - its
> just doesn't make
> >> sense - and its really frustrating me!!
> >>
> >> here's an example:
> >>
> >> Caused by: java.lang.NullPointerException
> >>        at
> org.apache.commons.codec.digest.DigestUtils.md5(DigestUtils.java:86)
> >>        at
> org.apache.commons.codec.digest.DigestUtils.md5Hex(DigestUtils.java:108)
> >>        at
> hub.app.wicket.admin.ChangePasswordPage$1.onSubmit(ChangePasswordPage.java:49)
> >>        at
> org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1518)
> >> ...
> >>
> >>
> >>                 Form<User> form =
> new Form<User>("form", new
> >> CompoundPropertyModel<User>(new
> HibernateEntityModel<User>(User.class,
> >> u.getId()))) {
> >>                       �...@override
> >>                        protected void
> onSubmit() {
> >>                              
>  User u = getModelObject();
> >>
> >>                              
>  u.setPassword(DigestUtils.md5Hex(u.getPassword());
> >>                              
>  userDAO.save(u);
> >>
> >>                              
>  setRedirect(true);
> >>                              
>  setResponsePage(HubApplication.get().getHomePage());
> >>                        }
> >>
> >>                };
> >>                form.add(new
> Label("email"));
> >>                PasswordTextField password
> = new PasswordTextField("password");
> >>                form.add(password);
> >>                PasswordTextField
> repeatPassword = new PasswordTextField("repeatPassword");
> >>              
>  repeatPassword.setModel(password.getModel());
> >>                form.add(repeatPassword);
> >>
> >>                form.add(new
> EqualPasswordInputValidator(password, repeatPassword));
> >>                form.add(new
> SubmitLink("submitLink"));
> >>                add(form);
> >>
> >>
> >> This is just one example - we see elsewhere in the
> logs sometimes a
> >> textfield that is setrequired(true) ends up
> nullpointering somewhere
> >> when saving the object.
> >>
> >> What could do this?
> >>
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 




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

Reply via email to