How to make first Field Disable in dropdown | Community
Skip to main content
Level 3
April 19, 2023

How to make first Field Disable in dropdown

  • April 19, 2023
  • 2 replies
  • 1081 views

Dear all,

 

I have 4 static values in my dropdown, like below

 

 

 

Here my requirement is that I want to make first field should be always HomePage Section and it should be disabled always.

 

How can I do this ?

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

2 replies

Community Advisor
April 19, 2023

@subnaik You just simply need to set "disabled" property as true on the option that you want to disable. This property is of Boolean type.

Here is the documentation.

https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/select/index.html

 

subnaikAuthor
Level 3
April 20, 2023

Hi All and @salamswapnil ,

 

I am following the same documentation only .

But my requirement is that Homepage Section always be in the first option and always be disabled like below

 

 

and also in some post I got below also highlighted in yellow.

 

But id I will use disabled (boolean ) = true then my all dropdown field is coming as disabled. That i do not want.

 

 

Sady_Rifat
Community Advisor
Community Advisor
April 20, 2023

Hello @subnaik ,

If I understand your requirement correctly, you want to make the Homepage option selected and disable it at a time. And if the author wants he can choose other options too. If so, you can use the selected and disabled options at a time.

<home-page jcr:primaryType="nt:unstructured" text="Home Page Selection" selected="true" disabled="true" value="home-page"/>