You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Markus <vi...@googlemail.com> on 2008/08/27 15:06:49 UTC

GetModelObject returns null-filled Object?

Following Code: (just Stubs used for Form / onSubmit for illustration)

 

Form {  

onSubmit { 

 

Users foo = (Users) this.getModelObject();

String bar = foo.getNick();

 

//Hibernate-Validator validateForm()

if (!validateForm(foo)) {

 (…)

}

 

 

When I use the debugger and look at foo, every variable is filled with null,
but bar contains the right value?

Why is this the way it is? Can I change it? 

Because Hibernate Validator also can´t read out the correct content and says
it is null or empty :(

 

Thanks for you help.

Markus

 


Re: GetModelObject returns null-filled Object?

Posted by James Perry <ja...@gmail.com>.
What model are you using for the form? How are you setting it?

While you're there have a look at IFormValidator (look at its
implementations to see how to use it) as it's much neater to add your
Hibernate validator like this rather then hard coding it in your
overridden onSubmit method.

Best,
James.

On Wed, Aug 27, 2008 at 2:06 PM, Markus <vi...@googlemail.com> wrote:
> Following Code: (just Stubs used for Form / onSubmit for illustration)
>
>
>
> Form {
>
> onSubmit {
>
>
>
> Users foo = (Users) this.getModelObject();
>
> String bar = foo.getNick();
>
>
>
> //Hibernate-Validator validateForm()
>
> if (!validateForm(foo)) {
>
>  (…)
>
> }
>
>
>
>
>
> When I use the debugger and look at foo, every variable is filled with null,
> but bar contains the right value?
>
> Why is this the way it is? Can I change it?
>
> Because Hibernate Validator also can´t read out the correct content and says
> it is null or empty :(
>
>
>
> Thanks for you help.
>
> Markus
>
>
>
>

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