For example, a form that is used to generate a report which displays a year dropdown. This dropdown contains the previous year, the current year and the following year.
In order to do this, you MUST tie the field to any dynamic list just for the sake of Ebase considering it a properly set up dynamic list. Once you do this, you are free in the before page event to do something like this:
Code: Select all
fields.REPORTYEAR.list.buildList();
fields.REPORTYEAR.createCustomList();
fields.REPORTYEAR.list.add(new Date().getFullYear()-1);
fields.REPORTYEAR.list.add(new Date().getFullYear());
fields.REPORTYEAR.list.add(new Date().getFullYear()+1);
TypeError: Cannot call method "buildList" of null
It might seem like a small detail but it would be nice to remove this requirement of tying the field to a random DL just so you can build a dynamic list at run time. It seems weird to have to tie the field to a DL that has nothing to do with what the drop down will ultimately contain.