It's all about the answers!

Ask a question

protecting a field based on other fields


Akshay Panchakshari (37429) | asked Jul 21 '16, 7:41 a.m.
edited Jul 21 '16, 7:45 a.m.

Hi All,

I have two radio buttons "Yes" and "No". Now i want to make certain fields protected or read-only when user selects "No". Any thoughts on this ? I have looked at adding a script based condtion as pre-condtion but problem with this approach is that the work item needs to be saved in order to evaluate the conditons. In my case i want script to be triggered as soon as user selects "Yes" or "No"  

Thanks

Akshay P.

Accepted answer


permanent link
Ralph Schoon (63.3k33646) | answered Jul 21 '16, 7:44 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Precondition read only on condition and a condition. See
Process Enactment Workshop for the Rational solution for Collaborative Lifecycle Management
and
https://jazz.net/wiki/bin/view/Main/AttributeCustomization
and https://rsjazz.wordpress.com/2015/06/19/a-custom-condition-to-make-attributes-required-or-read-only-by-role/
Akshay Panchakshari selected this answer as the correct answer

Comments
Akshay Panchakshari commented Jul 21 '16, 10:16 a.m.

Thank you for the response Ralph but as i mentioned in my question, i want my scripts to be executed as soon as value of the attribute changes( when user selects "Yes" or "No"). Like it works in case of validators or calculated values (when added dependency on the fields). Unfortunately i could not find such functionality in the links you have provided :(


Ralph Schoon commented Jul 21 '16, 10:24 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

1st, the condition and the effect is executed as soon as the value changes in the dependent attribute.
2nd this is the only way this can be done. There is as far as I know no other way to make an attribute read only dynamically. 

Process Enactment Workshop for the Rational solution for Collaborative Lifecycle Management  explains JavaScript https://jazz.net/wiki/bin/view/Main/AttributeCustomization  the JavaScript API and https://rsjazz.wordpress.com/2015/06/19/a-custom-condition-to-make-attributes-required-or-read-only-by-role/ and https://rsjazz.wordpress.com/2015/08/07/a-custom-condition-to-make-attributes-required-or-read-only-by-role-version-2/ explain the mechanism that is used, why it is the only one, and how it works with a Java based example.

This should provide you with all you need.


Akshay Panchakshari commented Jul 21 '16, 11:30 a.m.

Hi Ralph,

Yes you are correct!! I am sorry, I was in a assumption that the pre-conditions would execute only after clicking the save button on work item, which is wrong.I implemented it using java script and it working great now !!

Thanks again :)


Ralph Schoon commented Jul 21 '16, 11:36 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Your answer


Register or to post 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.