I have a text type property for Year and need to validate it so that it accepts only 4 digit year number. I had configured the Use Validate in the advance tab of property and harness is Enabled with Client Side validation.
When I key in a three digit number in Year textbox and move the focus away, the validation is not getting fired and hence no error message is displayed. Tried with event change and action of Post Value and Refresh section.
Can anyone suggest what else should be done for displaying the message. (attaching the UI behaviour and edit validate java code)
PS : I'm using V7.2
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Thanks for your suggestion. I tried and it does work, albeit partially.
The first time I trigger it , the error message "The field Year should be at least 4 characters long" comes for a second and disappears. It stays only on the second trigger. What I mean by second trigger - shifting the focus back to the Year text input and shifting it away. Please refer to the screenshot.
On another note, lets say I do have a custom validation to be done. How can I implement it using Edit Validate?
Thanks for replying. I had implemented the Edit Validate rule in Use Validate of the property form and had given the Post Value to clipboard event on change action. But the validation wasnot happening on change of control.
I figured out what was the issue. The section page(which includes the textboxes) in clipboard was showing as classes on load. It was only after submitting the .pxObjClass was assigned. So I made changes to invoke the page with correct class on load itself. Now the Edit Validates are firing correctly.
Thank you for posting your query on PSC. This looks like an inactive post and hence, we suggest you create a new post for your query. Click on the Write a Post button that’s at the top of our Pega Support Community homepage. Once created, please reply back here with the URL of the new post.
We have also sent you a private message opening up a communication channel in case you have any further questions.