Pega out of the box control Auto-Complete gives you the ability to type in few characters and based on the characters it gives you back the results based on the Source provided which can be Data page, RD etc.
Auto-Complete as a control does not validate the value selected or typed in manually is valid according to the source list of values. How can I validate the autocomplete if not select any value from dropdown list.
But right now I applied the same as Sushanth Kommera said earlier post.
See the post . But in Pega 8.7 it’s not working for me.
So, overcome this issue I found one solution. And it’s work perfectly for me.
Add OOTB ‘lodash’ JS and ‘AutoCompleteValidation’ (attached) files to your harness.— You can download the file from previous post. Click Here
In autocomplete control, go to presentation tab and include ‘autocomplete-validate’ in ‘Cell read-write classes’.
Add on change action & call the “setupAutoCompleteValidation” function
In the post referenced above there are two javascript files to be attached to the Harness: Lodash and Autocomplete. As Lodash library is already included in Pega 8.8 there is no need to add javascript file instance, just the existing one needs to be referenced in the Harness:
Also, LoadAutocompleteValidation,js script had to be adjusted as the function for adding validate error mentioned in the previous post looks to be not there any more. The updated version is attached, it’s adding error in Pega valiation error style but not using any Pega API as I coulnd’t find any suitable.
@Oleg ShepelevThanks a lot for your step by step guide and the updated LoadAutocomplete.txt. However, I still do not see any error message below my autocomplete field. Any ideas what could be the issue for that?
I also get this (!) in my code in line 54 (see screenshot).