Back Forum Reply New

validation of nullable Integer

Hi, I'm a newbie with spring web flow and I have a question on validation.

I just tried to do an example web flow with validation.

My web model object contains a Integer field that is defaulted to a value of 9.  I added a validation method to the model object, and it is being executed when I click Submit button from the form.  When I update the value on the form, and click submit, the value is being passed back in the model object, and I can see the new value in the validation method.

However, if I clear the value from the form and hit submit, when the validation method is executed, the Integer value in the model object stays the same (I thought it would be set to null)

How do I make it so that if the user clears the fields, and submits the form, the Integer in the model gets set to null?
¥
Back Forum Reply New