I have a DataObject that can be added and edited in a ModelAdmin. I have a particular field in the CMS that must have a number entered.
I tried using:
public function getCMSValidator() {
return new RequiredFields('FirstName', 'Surname', 'BestNotesID');
}
But when I submit the EditForm without the number I just get a blank grey area in the CMS_right area and this error message:
validationError('BestNotesID', '\"Best Notes ID\" is required.', 'required'); statusMessage('Validation failed', 'bad');Behaviour.addLoader(hideLoading);
So I can see that it does want to require the Fields but the behavior I get is unexpected. How do I handle the exception so that a nice error message is displayed and the EditForm is put back so the error can be corrected?