Ids are not removed when component is destroyed

Ive noticed this with tabs. If i have a function that dynamically creates tabs with nested components, when that tab is closed or destroyed, and i create another tab with the same id, i get a bunch of non unique id errors. An example of this is a chat room where a user enters and exits. If the chat tab is closed, and a user reenters the the room with a new tab the error will occur. Is there a way to ensure the assigned ids are removed?

Hello,

If you speak about the situation when tab is removed by pressing the ‘Close’ button - you’ve found a bug. The corresponding view should be destroyed in this situation and we will fix it in the next update.

But if you destroy the tab by programmatically calling a removeOption method - you should as well remove the corresponding view, otherwise, the “non-unique-id” error will chase you.

Webix views are removed by the removeView method.

As a temporary workaround for the above-mentioned bug tabbar onItemClick event can be used: http://webix.com/snippet/f16566d5.

Or, if you have an active license, you can use more handy events (onBeforeTabClose or onOptionRemove) that are already available in Webix 2.0.6 version.

The events as well as the fix will be available in Webix 2.1 (in GPL as well).

Helga,

Thanks, it’s actually pertaining to the tab close button. Thanks for the workaround.

Kenneth