Hello,
I have following setup:

The first input is a dropdown with entries 1 to 10. The following three inputs are placed into a panel named "panel_child". If the user selects the count of his children, the panel should be displayed in the count, he selected.
I wrote a rule for the dropdown if the value is changed with following code:
var childCount = this.value;
var panelChildCount = panel_child.instanceManager.instanceCount;
if (childCount > panelChildCount) {
var instancesToAdd = childCount - panelChildCount;
for (var i=0; i<instancesToAdd; i++) {
panel_child.instanceManager.addInstance();
}
} else if (childCount < panelChildCount) {
var instancesToRemove = panelChildCount - childCount;
for (var i=0; i<instancesToRemove; i++) {
panel_child.instanceManager.removeInstance(panel_child.instanceIndex);
}
}
If only one or two panels are to be added or deleted, it runs smoothly. However, when I need to add or delete many, it becomes very very slow.
Did I do anything wrong in my code?
Thanks for helping me!
Andrea