how to make reference field readonly in UI page

fgh1
Tera Contributor

I want to make reference field readonly on popup window using UI page. earlier I added that but still it is replacing with other value after making it readonly

 

fgh1_0-1703753720607.png

still it is giving me to change incident number after making readonly.

 

code in ui page :

html:

<label for="incident" id="inputLabel3"  class="makeMandetory" style="font-size: 20px;">Current Incident Record</label><br/>
<g:ui_reference name="incident" id="incident"  
table="incident" value="${jvar_pref}" displayValue="${jvar_pref2}"/><br/><br/>

client script:

var ro = gel('sys_display.incident');
ro.readOnly = true;
 
Thanks in advance!!
 
7 REPLIES 7

Maik Skoddow
Tera Patron
Tera Patron

Hi @fgh1 

why don't you use the correct HTML syntax to make a field read-only?

See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly 

Maik

In normal html it is working but in UI page it is not reflecting by making it readonly="readonly"

Danish Bhairag2
Tera Sage
Tera Sage

Hi @fgh1,

 

Use this line of in ur code & check if it helps

<g:ui_reference name="incident" id="incident"  
table="incident" value="${jvar_pref}" displayValue="${jvar_pref2}"/ readOnly><br/><br/>

 

Thanks,

Danish

 

it is giving syntax error