Is it bad practice to access control._source.config.listOptions ?
Content
Hi all,
I have a requirement that a list of values be retrieved via Ajax and pushed into a drop down list. There are several ways I can do this but one way I've tried I like but not sure if its best practice.
I have an attribute defined on my model as type Text. I dropped the control for this on an interview screen as type Drop Down, with a customName property of "courseSearch".
I set the default value for the drop down to "... loading ..". Then I wrote some JS that looks like this:
OraclePolicyAutomation.AddExtension({
customInput: function (control, interview) {
if (control.getProperty("customName") == "courseSearch"){
var newOption = {
displayText : "Option1",
nodeDepth:1,
rawDisplayText : "RawOption1",
value: "1"
};
control._source.config.listOptions.push(newOption);
}
}
}) 0