Class: RequiredValidatorFactory

Oracle® JavaScript Extension Toolkit (JET)
5.0.0

E90577-01

QuickNav

RequiredValidatorFactory

Version:
  • 5.0.0
Since:
  • 0.6
Module:
  • ojvalidation-base
A factory implementation to create an instance of the built-in required validator of type oj.RequiredValidator.
Example

create an instance of the required validator using the factory

var rvf = oj.Validation.validatorFactory(oj.ValidatorFactory.VALIDATOR_TYPE_REQUIRED); 
var options = {'hint' : 'a value is required for this field'};
var requiredValidator = rvf.createValidator(options);

Methods

createValidator(options) → {oj.RequiredValidator}

Creates an immutable validator instance of type @link oj.RequiredValidator that ensures that the value provided is not empty.
Parameters:
Name Type Argument Description
options Object <optional>
an object literal used to provide an optional hint and error message. See oj.RequiredValidator for details.

Returns:
Type
oj.RequiredValidator