Validation failed for 'FieldName', with value: null

Questions and answers for designing and implementing forms in Servoy

Validation failed for 'FieldName', with value: null

Postby Harro-DUS » Wed Dec 28, 2011 11:48 am

Hi,
I’m using a MS-SQL-Database. Only datetime-fields allow NULL-values.

Now, when I step from field to field on an form, by pressing TAB, I get the following error when a field is empty:

Validation failed for 'email', with value: null
> java.lang.IllegalArgumentException: Validation failed for 'email', with value: null

What is wrong?

Thanks for Info
Harro
Harro-DUS
 
Posts: 16
Joined: Wed Dec 07, 2011 5:49 pm

Re: Validation failed for 'FieldName', with value: null

Postby ngervasi » Wed Dec 28, 2011 4:07 pm

You shouldn't get any error until you try to save to the DB, are you saving on onFocusLost of the fields? If autosave is turned on it should save only when you click outside the fields, not when you move from one to another.
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: Validation failed for 'FieldName', with value: null

Postby jcompagner » Mon Jan 09, 2012 5:44 pm

as nicola is saying that exception you shouldn't get when tabbing over fields.. That is not the db complaining but servoys null check, but still that shouldn't happen when you don't change anything..
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Validation failed for 'FieldName', with value: null

Postby Hans Nieuwenhuis » Tue Jan 10, 2012 11:52 am

what if You use databaseManager.nullColumnValidatorEnabled = false;

I set this in the onOpen method of my solution
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands


Return to Forms

Who is online

Users browsing this forum: No registered users and 2 guests

cron