I want to make a list of parts for my HMI. There should be 8 parts in the array. I saw an example in the composites section with a local script that does this. I tried to replicate it but I'm not getting a result.
Here is the example in the documentation:
https://docs.webiq.de/docs/webiq-designer-manual/#_composite_widgets_how_it_works
This is the local script:
Â
Â
module.run = function (self) {
fLog("module ran");
//Place your Code here
shmi.onReady({controls:{
"srcCtrl": ".cartridge"
}}, (resolved)=> {
let srcCtrl = resolved.controls.srcCtrl,
count = 8,
token = [];
fLog("hmi ready");
if (srcCtrl) {
fLog("found cartridge control");
var config = srcCtrl.getConfig();
for (var i = 1; i <= count; i++) {
var newConf = shmi.cloneObject(config);
newConf.replacers.index = i;
let p = srcCtrl.element.parentElement;
token.push(shmi.createControl("group", p, newConf, "DIV", null)); // see documentation WebIQ Visuals Reference
}
}
/* called when this local-script is disabled */
self.onDisable = function () {
token.forEach(function (control) {
shmi.deleteControl(control, true);
});
self.run = false; /* from original .onDisable function of LocalScript control */
};
});
};Â
Â
I eventually want the count to be flexible.
The last log I can see is "module ran" which shows it's never running onReady. I've attached images of how I have my layout.