How to add values to a dropdown upon initialize
I am creating a dropdown list - where users can choose the proper year of business.
This dropdown needs to be customized to the user:
- Values begin at the year the business began to generate hazardous waste
- I need to add values for each year - up to the current year.
I want the current year to be calculated instead of static.
How do I add values to a dropdown list?
In LiveCycle - I would do something like this:
for (var i=dateBaseYear.rawValue; i<=dateCurrentYear.rawValue; i++)
{
//console.println(i);
this.addItem("" + i); //needed to add a string in front of 'i'. not sure why
}
Is there a similar solution for AEM Forms?