Standardized validation & EntityFieldError for required fields

Posts   
 
    
spatches
User
Posts: 8
Joined: 20-Feb-2007
# Posted on: 20-Mar-2007 21:47:51   

Is there a standard way to turn on the validation of required fields so that the IDataErrorInfo is set and the WinForms controls display a generic "this field is required" message? Or, do I need to write specific validator overrides, validate each required field, and add the error info for databinding?

It seems the default behavior is to let it go by and throw a SQL error because the column is not nullable.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 21-Mar-2007 07:50:37   

You should implement the validation yourself, as described in the manual "Using the generated code -> Validation per field or per entity". Although you can try to automatically generate the validation logic of the required fields, by modifying the templates / add a template, to generate the validation inside the entity classes or in extra classes for validation

I find the following threads worth reading: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=6258 http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=9207 http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=9160