|
|
|
Re: Form validation in Contacts Application [message #1768295 is a reply to message #1767694] |
Mon, 17 July 2017 07:46 |
|
Stéphane,
Matthias is right, the form validation code here is not quite correct. I will try to improve the form in the following weeks. Thanks for pointing that out!
Basically, manually adding an error status to a field is only required for complex cases. If you do that, you have to make sure the status is also removed when the field values become correct. (This is what doesn't happen in the contacts app.)
For most cases however it should be sufficient to override execValidateValue() (field validation) or execValidate() (form or form handler validation) and throw a VetoException with a corresponding message if the validation fails. Mandatory fields can be marked by setting getConfiguredMandatory() to true. This property can also be manipulated at runtime using field.setMandatory(true), for example in the execValueChanged() of another field.
Regards,
Beat
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03008 seconds