Skip to main content
Level 3
July 28, 2022
Risolto

Programmatically adding Dropdown values do not show up for content fragments

  • July 28, 2022
  • 2 risposte
  • 746 visualizzazioni

I created a drop down dialog for a content fragment 

ui.content/src/main/content/jcr_root/conf/aem-test/settings/dam/cfm/models/test/.content.xml

 

<color jcr:primaryType="nt:unstructured" listOrder="24" valueType="string" showEmptyInReadOnly="true" metaType="enumeration" required="on" name="color" fieldLabel="Color" emptyOption="true" sling:resourceType="granite/ui/components/coral/foundation/form/select" renderReadOnly="false"> <optionsMultifield jcr:primaryType="nt:unstructured"> <item0 jcr:primaryType="nt:unstructured" fieldLabel="Error" fieldValue="error"/> <item1 jcr:primaryType="nt:unstructured" fieldLabel="Warning" fieldValue="warning"/> <item2 jcr:primaryType="nt:unstructured" fieldLabel="Notification" fieldValue="notification"/> </optionsMultifield> <granite:data jcr:primaryType="nt:unstructured" /> </color>

 

 

 

But when building and loading the cfm the dropdown is empty

There are no visible errors in the browser or in the error.log except for a warning

 

28.07.2022 11:15:22.354 *WARN* [[0:0:0:0:0:0:0:1] [1659032122149] GET /editor.html/content/dam/test/content-fragments/test HTTP/1.1] org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex This index is deprecated: /oak:index/lucene; it is used for query Filter(query=select [jcr:path], [jcr:score], * from [nt:base] as a where contains(*, '"/content/dam/test/content-fragments/test"') /* xpath: //*[jcr:contains(., '"/content/dam/test/content-fragments/test"')] */ fullText="/content/dam/test/content-fragments/test", path=*). Please change the query or the index definitions.

 

Questo argomento è stato chiuso alle risposte.
Migliore risposta di HeenaMadan

There is no extensibility in content fragments to create dynamic drop-downs. Fields are limited and no Api is there to customize fields. But you can overlay the jsp script used to generate the dropdown options from static list. Overlay 

/libs/dam/cfm/admin/components/datasources/optionrenderer/optionrenderer.jsp

and try. Hope this helps! 

2 risposte

Sachin_Arora_
Community Advisor
Community Advisor
July 29, 2022

Dynamic data in dropdown for Content Fragment is not possible OOTB as per this blog :
https://blogs.perficient.com/2019/09/06/dynamic-dropdowns-in-aem-content-fragments/

 

@juanec2  Did you try customizing as explained in the blog?

HeenaMadan
Community Advisor
HeenaMadanCommunity AdvisorRisposta
Community Advisor
July 29, 2022

There is no extensibility in content fragments to create dynamic drop-downs. Fields are limited and no Api is there to customize fields. But you can overlay the jsp script used to generate the dropdown options from static list. Overlay 

/libs/dam/cfm/admin/components/datasources/optionrenderer/optionrenderer.jsp

and try. Hope this helps!