Panel.instanceManager.addInstance/removeInstance very slow | Community
Skip to main content
ajur
New Participant
November 9, 2021
Solved

Panel.instanceManager.addInstance/removeInstance very slow

  • November 9, 2021
  • 1 reply
  • 857 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mayank_Tiwari

@ajur ,

I am also able to reproduce this issue on 6.5.10, when more than 3 instances are added or removed. Seems like a bug. Please log a support case so that it can be fixed. Thanks!

1 reply

Mayank_Tiwari
Mayank_TiwariAccepted solution
Employee
November 9, 2021

@ajur ,

I am also able to reproduce this issue on 6.5.10, when more than 3 instances are added or removed. Seems like a bug. Please log a support case so that it can be fixed. Thanks!

ajur
ajurAuthor
New Participant
November 10, 2021

Uhm, that's pity. I try to find a short-term solution myself for so long.