Constructor
new module:br-validation /Validation Result(oValidation Result Listeneropt)
Creates a new instance of ValidationResult
.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
oValidationResultListener |
module:br-validation |
<optional> |
Listener informed when the validation result is available. |
Methods
get Failure Message() → {null|string|undefined}
Gets any message that validation may have returned if validation was not successful.
Returns:
the failure message or null if there isn't one.
- Type
- null | string | undefined
has Result() → {boolean}
Whether or not validation has completed for this ValidationResult.
Returns:
true if setResult has been called, false otherwise.
- Type
- boolean
is Valid() → {boolean|null}
Whether or not validation succeeded.
Returns:
true if the validation succeeded, false if it failed and null if it has not yet happened.
- Type
- boolean | null
set Result(bIsValid, sFailure Messageopt)
Specifies the result of validation.
This should only be called once during the lifetime of the ValidationResult
.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
bIsValid |
boolean | whether or not the current validation succeeded or failed. |
|
sFailureMessage |
string |
<optional> |
a message describing why validation failed if it did. Can be omitted if validation succeeded. |