07-22-2015 07:35 AM
Is there a way in EGRC 5.1 to dynamically restrict the editability of a field, a ~"<set-readonly>" operation similar to the existing <set-visible> that is evaluated <on-change> ?
02-04-2016 06:16 AM
There are multiple options for you to do it.
But there isn’t a direct way for doing it based on a ‘<on-change>’ event, as you can do for the <set-visible> or <set-required> elements, for example.
1- <field name="readonly1" readonly="true">
2- <field name="readonly2" readonly="isScreenReadOnly()">
3- <field name="readonly3" readonly="incidentStatus = 'validated'">
4- The dynamic tricky way needs to use an additional field:
<set-value name="temp.x_flg" value="true"/>
<field name=" temp.x_flg" type="boolean">
<field name="readonly4" readonly="temp.x_flg">
Cheers and good luck,
02-05-2016 12:40 PM
There is currently no <set-readonly> functionality for the on-change event. I don't think that the example provided can dynamically set the field to readonly on the page. This is because the <set-value> argument used by <on-change> only dynamically sets the value of the field name and cannot dynamically update the attributes of that field.
However, upon clicking 'Apply' or 'Save' the field in this example would then be updated to readonly.