Select dropdown is not getting populating using datasource via Model class | Community
Skip to main content
Level 2
Apr 29, 2021 5:54 AM UTC
Solved

Select dropdown is not getting populating using datasource via Model class

I am working on a migration from 6.4 to 6.5. We have a basepage component which has a select dropdown for the field pageType. Please see the below screenshot.

The datasource node is responsible to populate the dropdown. The datasource node points to an html page which calls the Model class(As seen in above screenshot). Model class is populating the data based on language configuration.

 

Issue :

In AEM 6.4 local the dropdown is getting populated without any issue. But when I check the same in my AEM 6.5 local the dropdown is not getting populated. (Note : This is happening before as well as after doing the Coral 3 migration.)

 

Can someone please help me understand what might be the possible cause?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Asutosh_Jena_
Asutosh_Jena_Accepted solution
New Participant
Apr 29, 2021 6:07 AM UTC

Hi @ks_hitijingole 

 

Can you confirm if the model class is getting executed?

If model class is working as expected, then we need to see the datasource from where the data is loading in the Sling Model.

 

Also you can remove the absolute path for the resource type and provide a relative path i.e. instead of /apps you can start from roche/diagnostics.......

 

Thanks!

4 replies

arunpatidar
New Participant
Apr 29, 2021 9:31 AM UTC

You don't need to necessarily create a model to populate a dropdown that can be done in many other ways. I prefer using a servlet to create dropdown e.g.

https://aemlab.blogspot.com/2019/07/aem-touch-ui-dropdown-from-json.html

https://github.com/arunpatidar02/aem63app-repo/blob/master/java/DemoDailogDropdown.java

 

Translate
Arun Patidar
Asutosh_Jena_
Asutosh_Jena_Accepted solution
New Participant
Apr 29, 2021 6:07 AM UTC

Hi @ks_hitijingole 

 

Can you confirm if the model class is getting executed?

If model class is working as expected, then we need to see the datasource from where the data is loading in the Sling Model.

 

Also you can remove the absolute path for the resource type and provide a relative path i.e. instead of /apps you can start from roche/diagnostics.......

 

Thanks!

Translate
Level 2
Apr 29, 2021 3:58 PM UTC
Thank you @asutosh_jena_ . I was able to figure out what the issue was. The model class was trying to fetch cq:tags which were apparently missing. After adding the tags the issue was resolved.
Translate