Hi,
My requirement is to dynamically change the list in dropdown2 based on value selected in dropdown1 in Classic UI. I have 2 events configured to the listener in dropdown1. "loadcontent" and "selectionchanged". Below is the code snippet for listener event "selectionchanged". I have created a generic list through acs-commons and is using that as json data for optionsProvider.
selectionchanged="function(comp,val) {
var panel = comp.findParentByType('panel');
var textColor = panel.getComponent('textColor');
const colorMap = {
'bg-white':'all',
'bg-grey':'all-grey',
'bg-red':'black-only',
'bg-green':'black-only',
'bg-blue':'black-only',
'bg-yellow':'black-only'
};
var finalURL = '/etc/acs-commons/lists/' + colorMap[val] + '-text-color/_jcr_content.list.json';
console.log('Matching color is ',colorMap[val]);
eyebrowTextColor.optionsProvider = function(){
console.log(CQ.Util.eval(finalURL));
return CQ.Util.eval(finalURL);
}();
}"
The control goes inside eyebrowTextColor.optionsProvider = function(){}, and even prints the desired value in console. ie, console.log(CQ.Util.eval(finalURL)); But the options are not getting updated.