You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sigmar Muuga <me...@gmail.com> on 2010/07/05 09:37:43 UTC

Re: java.lang.IllegalArgumentException: Parameter modelObject cannot be null

Also "entity" is initalized for that organisation object.

On Mon, Jul 5, 2010 at 10:36 AM, Sigmar Muuga <me...@gmail.com> wrote:

> Hello,
> I am creating a form, my form has an instance variable:
> private Organization organisation;
>
> Also, organisation is initialized in constructor with new Organisation().
>
> Now I am creating a TextField, that uses the propertyModel:
> IModel<Organization> m1 = new PropertyModel<Organization>(organisation, "
> entity.name");
>  TextField<Organization> organisationName = new
> TextField<Organization>("organisationName", m1);
> organisationName.setRequired(true);
>  add(organisationName);
>
> But when I load the page, I get:
> java.lang.IllegalArgumentException: Parameter modelObject cannot be null
>
> I have read the docs and manuals about models etc, but this thing here is
> really weird..
>

Re: java.lang.IllegalArgumentException: Parameter modelObject cannot be null

Posted by "Dr. Wolf Blecher" <wo...@itk-engineering.de>.
Is in "entity" the field name also initialized? Try to set it to the empty
String in the initialization of entity.

Am 05.07.2010 09:37, schrieb Sigmar Muuga:
> Also "entity" is initalized for that organisation object.
> 
> On Mon, Jul 5, 2010 at 10:36 AM, Sigmar Muuga <me...@gmail.com> wrote:
> 
>> Hello,
>> I am creating a form, my form has an instance variable:
>> private Organization organisation;
>>
>> Also, organisation is initialized in constructor with new Organisation().
>>
>> Now I am creating a TextField, that uses the propertyModel:
>> IModel<Organization> m1 = new PropertyModel<Organization>(organisation, "
>> entity.name");
>>  TextField<Organization> organisationName = new
>> TextField<Organization>("organisationName", m1);
>> organisationName.setRequired(true);
>>  add(organisationName);
>>
>> But when I load the page, I get:
>> java.lang.IllegalArgumentException: Parameter modelObject cannot be null
>>
>> I have read the docs and manuals about models etc, but this thing here is
>> really weird..
>>
> 

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