Question
TCS
IN
Last activity: 16 Oct 2018 12:03 EDT
Edit validate not getting fired on property
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
Thanks,
Aparna
**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.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
TCS
IN
Hi Prajendra,
I'm using 7.2V.
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.
Thanks once again for your inputs.
Pegasystems Inc.
IN
Hi Aparna,
Thanks for writing to the PSC.
From Image it looks like you are using text control. You can use min and max option and type as number.
Let me know, if this helps.
Thanks:
Gurpreet
TCS
IN
Hi Gurpreet,
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?
Siemens
IN
Hi Aparna,
Like you said that the message is appearing for a second and then disappearing, it maybe due to page messages getting wiped out cause of a refresh probably.
Could you try the following.
Create a non-autogenerated section and use the following code in the HTML.
<script>
pega.u.d.KeepPageMessages="true";
</script>
Include this section in your main section.
Hope that helps.
TCS
IN
Can anyone help me out here?
-
Sweta Bhat SHETTY SONALI SANJEEVA seshu sai babu
Incessant Technologies
IN
Hi Aparna,
I believe you need to write Java Script validator to perform client side validation apart from Edit validate rule.
Java Script validator is a exact replica of Edit validate rule that you have written in Java code. I found few helpful links that will help you implement the same.
https://pdn.pega.com/using-javascript-client-side-validation/using-javascript-client-side-validation
https://docs-previous.pega.com/how-enable-client-side-validation-input-field-work-object-form
Hope this will help you.
Thanks
Rajesh
TCS
IN
Thanks Rajesh for the helpful input.
I see what you are trying to say. But different fields have different validations. So the Java Script Validator should be a combined code of all the Edit Validates?
Pegasystems Inc.
IN
Edit validate rule is triggered at the submit of the assignment not during on change of control.
You need to mention edit validate rule at Use Validate option of property form.
Pegasystems Inc.
IN
If you want to invoke edit validate rule during on change event you need to post the value to clipboard using PostValue action.
TCS
IN
Hi Prajendra,
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.
Updated: 31 Oct 2017 7:31 EDT
Pegasystems Inc.
IN
May I know the PRPC version so that I would try in that version and let you know
-
Pruthvi Raj Dara
Accepted Solution
TCS
IN
Hi Prajendra,
I'm using 7.2V.
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.
Thanks once again for your inputs.
Infosys Ltd
IN
Hi Aparna
What is the property in Edit validate rule?
Regards
HemallatahM.
Pegasystems Inc.
US