Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Touch Optimized UI - Default Value for Granite Dropdown

Avatar

Level 2

Hi,

Default Value for Granite Dropdown (Touch Optimized UI ) is not working for me.

I have followed information on how to create a dropdown control here:

https://docs.adobe.com/docs/en/cq/5-6-1/touch-ui/granite-reference.html#Form Inputs - Dropdown

I have created a it in the following way:

<relationID fieldDescription="Relation ID" fieldLabel="Relation ID" jcr:primaryType="nt:unstructured" name="./relationID" sling:resourceType="granite/ui/components/foundation/form/dropdown" value="SELECT_DEVICE"> <items jcr:primaryType="nt:unstructured"> <option_0 jcr:primaryType="nt:unstructured" text="Select Plan" value="SELECT_PLAN"/> <option_1 jcr:primaryType="nt:unstructured" text="Select Device" value="SELECT_DEVICE"/> <option_2 jcr:primaryType="nt:unstructured" text="Empty" value=""/> </items> </relationID>

 

PS - i am using granite/ui/components/foundation/form/dropdown but i noticed that there is also a granite/ui/components/foundation/form/select type. what is the difference between them?

Note, if i set the type to multiple I have the same problem and can;t set a default value for it.

1 Accepted Solution

Avatar

Correct answer by
Employee

A I wrote...

PS - i am using granite/ui/components/foundation/form/dropdown but i noticed that there is also a granite/ui/components/foundation/form/select type. what is the difference between them?

Note, if i set the type to multiple I have the same problem and can;t set a default value for it.

 

In the page you linked the the location in the repository is specified as "/libs/granite/ui/components/foundation/form/dropdown"

Opening the render.jsp file I see the following comment:

log.warn("@deprecated /libs/granite/ui/components/foundation/form/dropdown; please use /libs/granite/ui/components/foundation/form/select instead.");

Looking at the example here: https://helpx.adobe.com/experience-manager/using/creating-granite-datasource.html they are using "granite/ui/components/foundation/form/select"

View solution in original post

5 Replies

Avatar

Correct answer by
Employee

A I wrote...

PS - i am using granite/ui/components/foundation/form/dropdown but i noticed that there is also a granite/ui/components/foundation/form/select type. what is the difference between them?

Note, if i set the type to multiple I have the same problem and can;t set a default value for it.

 

In the page you linked the the location in the repository is specified as "/libs/granite/ui/components/foundation/form/dropdown"

Opening the render.jsp file I see the following comment:

log.warn("@deprecated /libs/granite/ui/components/foundation/form/dropdown; please use /libs/granite/ui/components/foundation/form/select instead.");

Looking at the example here: https://helpx.adobe.com/experience-manager/using/creating-granite-datasource.html they are using "granite/ui/components/foundation/form/select"

Avatar

Level 7

I hope it will help you - https://helpx.adobe.com/experience-manager/using/creating-granite-datasource.html but it is of type granite/ui/components/foundation/form/select 

Avatar

Level 2

Thank you both for your answers.

Regarding granite select vs dropdown:  In both of them the value / defautValue properties didn't work. The reason i also tried to use 'dropdown' is because that the 'value' property is in the documentation, in the granite 'select' the documentation does say how to populate with initial value \ default value.

Regarding the datasource: From what I understand the datasource is used to fill the possible values of the dropdown, and not a default Value/ initial value.

 

Thanks,

AI

Avatar

Level 2

Thanks, i was already aware of this URL.

But unfortunately this does not help me with my problem.

I was hoping that someone can help me from experience.

 

Thanks.

AI