Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

how to make textfield non editable in dialog box

amangoyal15
Level 3
Level 3

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.

10 Replies
Jitendra_S_Toma
Level 9
Level 9

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.

amangoyal15
Level 3
Level 3

PFA .

I  am not getting any field like disabled for xtype

edubey
Level 10
Level 10

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

Classic UI already has these available in framework

Gaston_Abasto
Level 1
Level 1

Jitendra S.Tomar wrote...

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.

 

and in Touch UI ?

AnonymousCh
Level 1
Level 1

Hi Gaston Abasto,

 

Did you find any resolution for this?

Nupur_Jain
Community Advisor
Community Advisor

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

riteshm19780411
Level 2
Level 2

Hi Amangoyal,

Add a boolean property like below :

properties :  readOnly type :Boolean value : true