AEM 6.3 Forms - How can I populate a dropdownlist from database? | Community
Skip to main content
fabioper85
New Participant
July 27, 2018
Solved

AEM 6.3 Forms - How can I populate a dropdownlist from database?

  • July 27, 2018
  • 11 replies
  • 7925 views

Hi everyone

I'm Fabio from Italy

I'm new about AEM Forms and I'm working on a project for a company!

We're building an Adaptive Form with a Form Data Model connected

We need to populate a dropdownlist from a database (on initialize), but I've no idea how to do

Can someone suggest me some working examples?

Thank you so much

Fabio

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mayank_Gandhi

Hi Fabio,

You may refer this thread for help on the approach Adaptive form dynamic Drop-down funtionality .

Somewhere you will have to write your own servlet and make a JDBC call to your database and bring the list to your repository. This approach can be merged with the sample approach to load the list in the dropdown from repository further as mentioned in AEM 6.0 Forms Help | Dynamically populating drop-down lists.

Also, if you can expose the list via JSON then you can even use jquery on the form initialize to load the list in the drop-down. For this approach, you may find a lot of samples available publically. Sharing few for reference:

How to populate a dropdownlist with json data in jquery? - Stack Overflow

How to Load Data Dynamically to Html Dropdownlist - CodeProject

11 replies

Mayank_Gandhi
Mayank_GandhiAccepted solution
Employee
July 27, 2018

Hi Fabio,

You may refer this thread for help on the approach Adaptive form dynamic Drop-down funtionality .

Somewhere you will have to write your own servlet and make a JDBC call to your database and bring the list to your repository. This approach can be merged with the sample approach to load the list in the dropdown from repository further as mentioned in AEM 6.0 Forms Help | Dynamically populating drop-down lists.

Also, if you can expose the list via JSON then you can even use jquery on the form initialize to load the list in the drop-down. For this approach, you may find a lot of samples available publically. Sharing few for reference:

How to populate a dropdownlist with json data in jquery? - Stack Overflow

How to Load Data Dynamically to Html Dropdownlist - CodeProject