ValidateField

The ValidateField component is used to validate the current contents of a user experience field component.

It is passed a reference to the Field, the MyInstance parameter, the FieldDefinition for the field and the current FieldUX. There are also three optional parameters that can be passed to the component, ElementName, subtype, and rangeValue.

ElementName is used specifically for the GI_NumericRange component to indicate which field is being validated or has validation errors (Start/End).

subType is used specifically for the GI_GUID component with regards to validation Multi-Select lists.

rangeValue is used specifically for the GI_Period and GI_NumericRange components to validate either numeric or date ranges to ensure that the start value isn’t greater than/after the end value.

It uses this information to determine the type of field, what validations are required and whether the current field value meets the validation rules.

If the field value fails to meet the validation rules, then a “Validation Message” is returned to the validate field component to be displayed on the screen and the field that failed validation will have the ValidationError CSS class applied to it which by default will outline the field in red.

This component is used within the Field components themselves (e.g., GI_String).

Updated on October 23, 2023

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support

Leave a Comment