BookmarkSubscribeRSS Feed
kheger
Fluorite | Level 6

Hi all,

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> ?

Kind regards,

Karin

2 REPLIES 2
porlpp
SAS Employee

Hi,

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.

Examples:

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:

  <field name="x_aux1">
   <label>x_aux1</label>
   <on-change>
      <set-value name="temp.x_flg" value="true"/>
   </on-change>
  </field>

  <field name=" temp.x_flg" type="boolean">
   <label>x_flg</label>
  </field>

  <field name="readonly4" readonly="temp.x_flg">

Cheers and good luck,

Luís Pereira
BrendanW
SAS Moderator

 

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.