Can we use datasource and manual options together in select coral component? | Community
Skip to main content
Level 3
February 24, 2022

Can we use datasource and manual options together in select coral component?

  • February 24, 2022
  • 1 reply
  • 853 views

I'm using AEM 6.5.8
and what I want is to do something like below

<select
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
fieldLabel="select"
name="./select">
<items jcr:primaryType="nt:unstructured">
<option1
jcr:primaryType="nt:unstructured"
selected="{Boolean}true"
text="option1"
value="option1"/>
<option2
jcr:primaryType="nt:unstructured"
text="option2"
value="option2"/>
</items>
<datasource
jcr:primaryType="nt:unstructured"
sling:resourceType="/test/run/url"/>
</link>
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Level 2
February 24, 2022

You can achieve the above by adding the two options as default in your datasource. This will ensure your datasource always return two results. I do not think adding a datasource and options work simultaneously. 

Level 3
February 25, 2022

Can you please provide me a sample code of datasource in select as I'm unable to find something on the net.