Making text readonly as read-only on the basis of validation script
Dear All, I need to create a validation script where the scenario is: 1, There is a custom attribute which has YES/No radion buttons 2, There is text field If user click No on the radio button then the text field will become read-only, following is the script which have created but its not working and giving some errors in a log which is also available below, i have also define it within RTC client > Workitems > Attribute Customization > Validations Please help me to resolve this issue and achive what i want to achieve
Script: ====
dojo.provide("org.example.workitems.providers.testvalidation");
dojo.provide("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("org.example.workitems.providers.testvalidation" , null, {
matches: function(workItem, configuration){
var rfc = workItem.getValue("arabbank.attribute.rfcisaproject");
console.log(rfc);
if(rfc == "arabbank.enumeration.rfcisproject.literal.l2"){
return ("arabbank.attribute.EPMOReference").readOnly = true;
}
return false;
}
});
})();
Log from the script: ===
!MESSAGE Error invoking validator com.ibm.team.workitem.valueproviders.VALIDATOR._gmqiYEyWEeWLi4nVJprtMQ
|
One answer
The script format is a "condition" script, why do you call it a "validation" script? You have made a condition script in a previous post (with an incorrect conditional testing though), why don't you just follow it as an example?
https://jazz.net/forum/questions/205091/condition-to-make-attribute-mandatory-on-the-basis-of-specific-state-and-specific-option-from-drop-down In the script above, this line is absolutely incorrect.
return ("arabbank.attribute.EPMOReference").readOnly = true; Comments Donald Nong you told me in this post https://jazz.net/forum/questions/204864/how-to-make-read-only-text-field-on-the-basis-of-condition
that you need to create another script for making in read-only in validations script. so i have created as you have said but still i'm not able to achieve what i want achieve.
Kindly me help me out in this case if can guide how to make my script correct or if have that working script for my case
Please help me out.
Donald Nong
commented Aug 30 '15, 9:37 p.m.
The "another script" is a condition script, not a validation script. You use a validation script to ensure the attribute is mandatory. You use a condition script to make the attribute read-only. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.