Class idx.form._ValidationMixin
Mix-in class to enable form widget perform validation, implemented according to
IBM One UI(tm) Validation.
Defined in: <idx\form\_ValidationMixin.js>.
Constructor Summary
Constructor Attributes | Constructor Name and Description |
---|---|
Field Summary
Field Attributes | Field Name and Description |
---|---|
Configurable flag of the validation timing, the widget fires validation when widget get input by setting true,
fire validation when widget get blur by setting false.
|
|
The message to display if value is invalid
|
|
The message to display if value is empty and the field is required
|
|
Indicate whether this widget must have a value
|
|
The position of the hoverhelpTooltip
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
_isEmpty()
Checks if value is empty.
|
|
_isValid(isFocused)
Tests if value is valid.
|
|
displayMessage(message, force)
Show error message using a hoverHelpTooltip, hide the tooltip if message is empty.
|
|
getErrorMessage(isFocused)
Return proper error message according to the error type
|
|
isValid(isFocused)
Extension point for user customizing validation rules.
|
|
refocus()
|
|
validate(isFocused)
Perform validation for the widget, called by "input" event if "instantValidate" setting to true,
called by "blur" event if "instantValidate" setting to false.
|
Field Detail
{boolean} instantValidate
Configurable flag of the validation timing, the widget fires validation when widget get input by setting true,
fire validation when widget get blur by setting false.
- Default Value:
- false
{String} invalidMessage
The message to display if value is invalid
{String} missingMessage
The message to display if value is empty and the field is required
{boolean} required
Indicate whether this widget must have a value
- Default Value:
- false
{String[]} tooltipPosition
The position of the hoverhelpTooltip
Method Detail
_isEmpty()
Checks if value is empty.
Should be override with the routine in a subclass
_isValid(isFocused)
Tests if value is valid.
Can override with the routine in a subclass.
- Parameters:
- {boolean} isFocused
- If the widget focused
displayMessage(message, force)
Show error message using a hoverHelpTooltip, hide the tooltip if message is empty.
Overridable method to display validation errors/hints.
By default uses a hoverHelpTooltip.
- Parameters:
- {string} message
- Error message
- {boolean} force
- Force displaying message if the value is true, no matter if the widget got focus or not.
getErrorMessage(isFocused)
Return proper error message according to the error type
- Parameters:
- {boolean} isFocused
isValid(isFocused)
Extension point for user customizing validation rules.
- Parameters:
- {boolean} isFocused
postCreate()
postMixInProperties()
refocus()
validate(isFocused)
Perform validation for the widget, called by "input" event if "instantValidate" setting to true,
called by "blur" event if "instantValidate" setting to false.
- Parameters:
- {boolean} isFocused