Expand my Community achievements bar.

SOLVED

Select dropdown is not getting populating using datasource via Model class

Avatar

Level 2

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.

ks_hitijingole_0-1619675300547.png

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?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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!

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

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!

Avatar

Level 2
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.

Avatar

Community Advisor

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

 



Arun Patidar