Validatable

Properties

4

Class hierarchy

isValidatable: Boolean= truereadonly
Identifies an object as an instance of Validatable class, or subclass thereof.
isValidatable: Boolean= truereadonlystatic
Identifies an object as an instance of Validatable class, or subclass thereof.

Misc

errorTip: Tooltipreadonly

A singleton error tooltip which activates on hover of invalid fields. before show, it gets a reference to the field and interrogates its active error list to display as the tip content.

Other

errorTip: Tooltipreadonlystatic

A singleton error tooltip which activates on hover of invalid fields. before show, it gets a reference to the field and interrogates its active error list to display as the tip content.

Please note: Not applicable when using widgets inside a shadow root

Functions

3

Removes an error message from the list of errors on this field.

By default, the field's valid/invalid state is updated; pass false as the second parameter to disable that if multiple changes are being made to the error state.

ParameterTypeDescription
errorString

A locale string, or message to remove. If not passed, all errors are cleared.

silentBoolean

Pass as true to skip updating the field's valid/invalid state.

Returns an array of error messages as set by setError, or undefined if there are currently no errors.

Returns: String[] -

The errors for this field, or undefined if there are no errors.

Adds an error message to the list of errors on this field. By default, the field's valid/invalid state is updated; pass false as the second parameter to disable that if multiple changes are being made to the error state.

Note, that you need to manually remove the added error with the clearError method to "release" the normal data update process (invalid data won't be synced). You can also use the 3rd argument of this method to automatically remove the error upon the next user interaction.

ParameterTypeDescription
errorString

A locale string, or message to use as an error message.

silentBoolean

Pass as true to skip updating the field's valid/invalid state.

temporaryBoolean

Pass as true to remove the error upon the next user interaction.