how to make textfield non editable in dialog box | Community
Skip to main content
amangoyal15
Level 3
Nov 8, 2016 6:17 AM UTC

how to make textfield non editable in dialog box

In my dialog box , i am getting some value in textfield based on the value selected from dropdown . But currently i can make changes in retrieved values that i don't want. I need to make it non editable so that the retrieved value will remain as it is .

 

Edit- If i make it disable than that textfield name property will not saved as JCR property.

Please assist.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

10 replies

Level 2
Aug 25, 2017 6:08 AM UTC

Hi Amangoyal,

Add a boolean property like below :

properties :  readOnly type :Boolean value : true

Translate
Nupur_Jain
Employee
May 15, 2017 3:39 PM UTC

Hi,

Unfortunately there is no widget property that can make your field non editable but there is listeners node available to take action on various widgets events. you can use loadContent event to explicitly set the field to readonly.

Here is the screenshot for your reference.

I have used simple jquery

function(field,record,path){ $("input[name='"+ field.name+"']"  ).attr("readonly",true); }

Hope this helps!

Thank you!

Nupur

Translate
Jitendra_S_Toma
Level 10
Nov 8, 2016 8:56 AM UTC

amangoyal15 wrote...

In my dialog box , i am getting some value based on the value selected from dropdown . But currently i can make changes in retrieved values that i don't want. I need to make it non editable so that the retrieved value will remain as it is .

 

Hi,

if it is classic ui, you can set disabled (true) as a property in textfield xtype node.

Translate
amangoyal15
Level 3
Nov 8, 2016 9:09 AM UTC

PFA .

I  am not getting any field like disabled for xtype

Translate
edubey
Level 10
May 15, 2017 4:41 PM UTC

You need to add that as a property with name disabled,  value 'true' and  type boolean.

Classic UI already has these available in framework

Translate
edubey
Level 10
Nov 8, 2016 8:01 AM UTC

Hi,

Touch UI or Classic UI?

Translate
amangoyal15
Level 3
Nov 8, 2016 9:06 AM UTC

for classicUI

Translate