How to add placeholder text to Dropdown in Component | Community
Skip to main content
Level 4
January 10, 2023
Solved

How to add placeholder text to Dropdown in Component

  • January 10, 2023
  • 2 replies
  • 3595 views

Hi Team, 
I'm creating a component with dropdown value. There I've added 2 values in dropdown from that one value is always selected. But I don't want that, I just want my dropdown empty when I add component to page. So is there a way I can add placeholder text or default value other than my original values ?? Form resource type is : granite/ui/components/coral/foundation/form/select

 

Thanks!

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

Hi,

The property called emptyText to add placeholder text, e.g.

emptyText = "Placeholder text..."

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 

2 replies

nitesh_kumar-1
Adobe Employee
Adobe Employee
January 10, 2023

Hi @tessa_learner1 ,

 

You can add a "default" option (placeholder text) and set the selected property for it, this can work as a placeholder when the dropdown is displayed.

 

Please check this thread for implementation details.

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-6-5-default-value-setup-in-select-component/m-p/351191 

 

Hope this helps!

 

Regards,

Nitesh

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
January 10, 2023
Arun Patidar