Javascript error with the change of ContainerControl

Hi to all,
I created a WebApp with Xojo.

In this App, I have some buttons and some ContainerControls.
At the open of the App I’ve a container and when I click on the buttons, I close the old container, I create a new Container and print it with container.EmbedWithin method.

I’ve a problem with this, if I press the buttons quickly, I get a Javascript error without a Xojo Crash or error.
If I press slowly on these buttons, I don’t get any errors.
In the Javascript error source, there is the name of the container followed by “.destroy”.

Are there any way to fix this problem?
Thanks to all

That’s not a lot to go on. Could you give the actual error text?

The error text is here:

Could not execute returned javascript: Xojo.controls.JspreIE0 is undefined Source: Xojo.controls['JspreIE0'].destroy(); new frameworkObject('VcjMV2qu',[]); Xojo.controls['VcjMV2qu'].setEnabled(true); new frameworkObject('HgSMEZeI',[]); Xojo.controls['HgSMEZeI'].setEnabled(true); new textlabel('D6tOwYi9',['TextChanged']); Xojo.controls['D6tOwYi9'].setEnabled(true); new textlabel('H8UdA8IC',['TextChanged']); Xojo.controls['H8UdA8IC'].setEnabled(true); new textlabel('NRb5KuBp',['TextChanged']); Xojo.controls['NRb5KuBp'].setEnabled(true); new textlabel('DAMs1ay7',['TextChanged']); Xojo.controls['DAMs1ay7'].setEnabled(true); Xojo.controls['DAMs1ay7'].setMultiline(true); new container('ElnUX1KJ',['Close','Open','Shown','Open']); Xojo.controls['ElnUX1KJ'].setEnabled(true); Xojo.controls['VcjMV2qu'].setEnabled(true); Xojo.controls['VcjMV2qu'].refresh(); Xojo.controls['HgSMEZeI'].setEnabled(true); Xojo.controls['HgSMEZeI'].refresh(); didFinishLoading(); Xojo.comm.triggerEvent('ElnUX1KJ','shown'); new frameworkObject('JOkeKjZP',[]); Xojo.controls['JOkeKjZP'].setEnabled(true); new textlabel('Iu4wyeG8',['TextChanged']); Xojo.controls['Iu4wyeG8'].setEnabled(true); new container('FUgpRq0S',['Close','Open','Shown','Open']); Xojo.controls['FUgpRq0S'].setEnabled(true); Xojo.controls['JOkeKjZP'].setEnabled(true); Xojo.controls['JOkeKjZP'].refresh(); didFinishLoading();
The error text continue with the same things repeated.

[quote=117384:@Stefano Basile]I’ve a problem with this, if I press the buttons quickly, I get a Javascript error without a Xojo Crash or error.
If I press slowly on these buttons, I don’t get any errors.[/quote]
By “quickly” do you mean pressing the button again before the new container has been displayed? This would be expected, as the container has to be sent to the browser and rendered before you can then remove it. On the click of the button, you should set a flag to prevent processing the action event of the button again until after the new container is shown (reset the flag in the container’s shown event).