optional DropDowns

2008-12-30 Thread Björn Tietjens

Hi,

I have a problem with an webform containing several dropdowns.
Each dropdown is getting a (shared) object and one of the objects (int) 
properties as model.

This way I can set the properties width and height of the object box.
Now the drop downs are supposed to be optional... and when no item was 
chosen a default value should be applied.
Not choosing an item from the dropdown and submitting the form resuts in 
an error saying that 'null' could not be set for the property of the 
model...

How can I make that work?

thank you for your help in advance!


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



Re: optional DropDowns

2008-12-30 Thread Matthias Keller

Hi Björn

You should probably either switch from  int  to  Integer  (which can be 
null) or provide an own values list which includes your default entry 
for example with value -1 (or customize the DropDownChoice to do that)


Matt

Björn Tietjens wrote:

Hi,

I have a problem with an webform containing several dropdowns.
Each dropdown is getting a (shared) object and one of the objects 
(int) properties as model.

This way I can set the properties width and height of the object box.
Now the drop downs are supposed to be optional... and when no item was 
chosen a default value should be applied.
Not choosing an item from the dropdown and submitting the form resuts 
in an error saying that 'null' could not be set for the property of 
the model...

How can I make that work?

thank you for your help in advance!


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



--
matthias.kel...@ergon.ch  +41 44 268 83 98
Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich
http://www.ergon.ch
__
e r g o nsmart people - smart software




smime.p7s
Description: S/MIME Cryptographic Signature


Re: optional DropDowns

2008-12-30 Thread Björn-Peter Tietjens

Hi
thank you for your help.
I did switch from  int  to  Integer and it works fine now.
Cheers B

Matthias Keller schrieb:

Hi Björn

You should probably either switch from  int  to  Integer  (which can 
be null) or provide an own values list which includes your default 
entry for example with value -1 (or customize the DropDownChoice to do 
that)


Matt

Björn Tietjens wrote:

Hi,

I have a problem with an webform containing several dropdowns.
Each dropdown is getting a (shared) object and one of the objects 
(int) properties as model.

This way I can set the properties width and height of the object box.
Now the drop downs are supposed to be optional... and when no item 
was chosen a default value should be applied.
Not choosing an item from the dropdown and submitting the form resuts 
in an error saying that 'null' could not be set for the property of 
the model...

How can I make that work?

thank you for your help in advance!


-
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