You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide an easier way for the user to add custom errors to an existing validationResult object
Detailed Description
Currently, the developer can create a new validationError object two ways:
Use newError(ARGUMENTS)
Or use getInstance('cbvalidation.models.result.ValidationError') and then populate that error object
Then the developer has to use addError() to add it to the ValidationResult.
Propose a new feature - something like addNewError() (not a terribly good name) that would accept all the arguments for a validationError (like newError) and add it to the list of errors (like addError).
Possible Implementation Ideas
/**
* Create a new error, then add it to the current error array
*
* @arguments all fields that would be part of a validationError object
*/
any function addNewError() {
addError(duplicate(errorTemplate).configure(argumentCollection = arguments));
return this;
}
The text was updated successfully, but these errors were encountered:
Summary
Provide an easier way for the user to add custom errors to an existing validationResult object
Detailed Description
Currently, the developer can create a new
validationError
object two ways:Use
newError(ARGUMENTS)
Or use
getInstance('cbvalidation.models.result.ValidationError')
and then populate that error objectThen the developer has to use
addError()
to add it to the ValidationResult.Propose a new feature - something like
addNewError()
(not a terribly good name) that would accept all the arguments for a validationError (like newError) and add it to the list of errors (like addError).Possible Implementation Ideas
The text was updated successfully, but these errors were encountered: