Question

2
Replies
482
Views
malliswar Member since 2016 4 posts
Wipro
Posted: 1 year ago
Last activity: 10 months 2 weeks ago

Error when using Edit-Validate on property level

Hi,

I have a requirement where I need to show the values entered in a section in read-only mode below the editable section, and in my section i configured a property with custom edit-validate rule. when edit-validate is triggered due to invalid entry in field the error is shown in both editable section and read-only, but i need it to show the error only in editable section.

Note: I am using tabbedscreenflow7 harness

Edit Validate code:

String IDNo=theValue.toString();
try{
if(IDNo!="" && IDNo.length()==10){
String First3 = IDNo.substring(0,3);
if(!First3.matches("[GAN]+")){
theProperty.addMessage("Enter a IDNumber with valid format value");
return false;
}else if(!IDNo.matches("[0-9a-zA-Z]+")){
theProperty.addMessage("Enter a valid alphabetic or numeric value");
return false;
}else{
String digitStr = IDNo.substring(3,IDNo.length());
for(int i=0; i<digitStr.length();i++){
char charValue = digitStr.charAt(i);
Integer.parseInt(Character.toString(charValue));
}
}
}else {
if(!IDNo.matches("[0-9a-zA-Z]+")){
theProperty.addMessage("Enter a valid alphabetic or numeric value");
return false;
}else {
theProperty.addMessage("ID Number should be 10 characters");
return false;
}
}
}catch(Exception e){
theProperty.addMessage("Enter a IDNumber with valid format value");
return false;
}
return true;
is there a way to achieve this?
Thanks
***Moderator Edit-Vidyaranjan: Updated Platform Capability***
Case Management
Share this page LinkedIn