Validation Api

Represents an object used to facilitate the form validation process by creating data structures required by the validationArray. These functions are available under the `convenienceApi.validation` namespace.

Methods

getFailedSummaryObject(validationMessage)Object
Get a validation object scoped to the summary with the given failure message
getFailedFieldObject(fieldId, validationMessage)Object
Creates a validation object scoped to a Field with the given failure message
getDefaultSummaryErrorForAction(actionName)String
Get a validation message string with the default error summary message for the given action
getSilentFailureObject()Object
Creates empty scope validation object with stopping submit message.
validateSaveResult(response, validationArray, options)Promise.<Object>
Performs validation of save result, pushes validation summary object onto the validationArray.
isValidInteger32(value)Boolean
Validates if provided string value represents valid 32bit integer number.
isValidNonNegativeInteger32(value)Boolean
Validates if provided string value represents valid non-negative 32bit integer number.
isValidPositiveInteger32(value)Boolean
Validates if provided string value represents valid positive 32bit integer number.
isValidInteger64(value)Boolean
Validates if provided string value represents valid 64bit integer number.
isValidNonNegativeInteger64(value)Boolean
Validates if provided string value represents valid non-negative 64bit integer number.
isValidPositiveInteger64(value)Boolean
Validates if provided string value represents valid positive 64bit integer number.

Properties Details

getFailedSummaryObject(validationMessage) ⇒ Object

Get a validation object scoped to the summary with the given failure message

Returns: Object - a failed validation object that displays the given message in the error summary

Param Type Description
validationMessage String | List.<String> the message to display in the error summary

getFailedFieldObject(fieldId, validationMessage) ⇒ Object

Creates a validation object scoped to a Field with the given failure message

Returns: Object - a failed validation object that displays the given message on the field.

Param Type Description
fieldId String | Number id of the field that owns the validation object
validationMessage String the message to display in the field error.

getDefaultSummaryErrorForAction(actionName) ⇒ String

Get a validation message string with the default error summary message for the given action

Returns: String - a localized error summary message for the given action

Param Type Description
actionName String name of the actionName translation key. e.g. "save"

getSilentFailureObject() ⇒ Object

Creates empty scope validation object with stopping submit message.

Returns: Object - a failed validation object.

validateSaveResult(response, validationArray, options) ⇒ Promise.<Object>

Performs validation of save result, pushes validation summary object onto the validationArray.

Returns: Promise.<Object> - a promise which is resolved if validation errors have been handled, or is rejected otherwise.

Param Type Description
response Object the response object passed to the VALIDATE_SAVE event handler
validationArray Array.<Object> the validation object array passed to the VALIDATE_SAVE event handler
options Object the option object for customizing the validation process

isValidInteger32(value) ⇒ Boolean

Validates if provided string value represents valid 32bit integer number.

Returns: Boolean - True if provided value is in range between MIN_INT32 and MAX_INT32, false otherwise.

Param Type Description
value String Input value

isValidNonNegativeInteger32(value) ⇒ Boolean

Validates if provided string value represents valid non-negative 32bit integer number.

Returns: Boolean - True if provided value is in range between "0" and MAX_INT32, false otherwise.

Param Type Description
value String Input value

isValidPositiveInteger32(value) ⇒ Boolean

Validates if provided string value represents valid positive 32bit integer number.

Returns: Boolean - True if provided value is in range between "1" and MAX_INT32, false otherwise.

Param Type Description
value String Input value

isValidInteger64(value) ⇒ Boolean

Validates if provided string value represents valid 64bit integer number.

Returns: Boolean - True if provided value is in range between MIN_INT64 and MAX_INT64, false otherwise.

Param Type Description
value String Input value

isValidNonNegativeInteger64(value) ⇒ Boolean

Validates if provided string value represents valid non-negative 64bit integer number.

Returns: Boolean - True if provided value is in range between "0" and MAX_INT64, false otherwise.

Param Type Description
value String Input value

isValidPositiveInteger64(value) ⇒ Boolean

Validates if provided string value represents valid positive 64bit integer number.

Returns: Boolean - True if provided value is in range between "1" and MAX_INT64, false otherwise.

Param Type Description
value String Input value