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

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

Avatar

Level 3

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>
2 Replies

Avatar

Level 2

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. 

Avatar

Level 3

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