Class: RequiredValidator

Oracle® Fusion Middleware Oracle JavaScript Extension Toolkit (JET)
12c (12.1.4)

E54107-01

QuickNav

oj. RequiredValidator

Constructor

new RequiredValidator(options)

Constructs a 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.

  • hint: an optional hint text. There is no default hint provided by this validator.
  • messageSummary: a custom error message summarizing the error

    Parameters:

    {label} - label of the component for which this message applies. The label may not always be available depending on the usage of the validator.

    Examples:

    "'{label}' Required"

  • messageDetail: a custom error message to be used for creating detail part of message, when the value provided is empty. NOTE: the parameter 'message' has been deprecated.

    Parameters:

    {label} - label text of the component for which this message applies. Examples:

    "A value is required for the field '{label}'.

Source:

Methods

getHint() → {String|string|null}

A message to be used as hint, when giving a hint on the expected pattern. There is no default hint for this property.
Source:
Returns:
a hint message or null if no hint is available in the options
Type
String | string | null

Init(options)

Initializes validator instance with the set options
Parameters:
Name Type Argument Description
options Object <optional>
Source:

validate(value) → {boolean}

Validates value to be non-empty
Parameters:
Name Type Description
value Object | string | number that is being validated
Source:
Throws:
when fails required-ness check
Type
Error
Returns:
true if validation was was successful the value is non-empty
Type
boolean