Can't create new windows after using multiview.addView()

Hello everyone,

yesterday I came across an issue that I didn’t have before and thought I’d share it here. In Webix 5.2 PRO, when you add a view to a multiview using addView() and then try to create a window using webix.ui(), the window will not render properly upon calling its show() method.

This happens only in Webix 5.2 PRO. Version 5.1 and 5.2 GPL work fine.

Here is a snippet with an example: https://snippet.webix.com/f7frxmmi

same here

in snippets PRO version is 5.2.4, while GPL is 5.2.1
but anyway, do not add ready view as child. add its config instead.
https://snippet.webix.com/pm8eud9d

@integral I know that it works that way. The problem is that I tried to upgrade Webix for an already existing project that relies heavily on adding views to multiviews. I’m already working on a rewrite, though.

Other than that, this behaviour is quite obviously unintended. The multiview and window have nothing to do with each other and the order of creation shouldn’t completely break one of them. Adding an already created view to the multiview still works. It just breaks the window if you do it before you create the window. If you do it after the webix.ui() call for the window, it works.

I can easily work my way around that. I still thought I’d share.

Hello,

Yep, I agree that it doesn’t look nice, but still the intended way to add extra views is providing their configuration, as the addView method will end with webix.ui in fact.

We introduced a few enhancements into ui creation logic between 5.2 and 5.3, and the duplicate webix.ui calls may now result in this kind of a conflict.

We will double check the issue, but anyway please note that you need to follow the recommended way and provide config for .addView() to stay on the safe side.

@Helga Alright. Thanks for the confirmation. I’ll try to avoid adding view objects then.

@Helga I faced another issue with addView() today - this time with the tabview.

I have a layout with isolate: true and inside it is a tabview. When I add another tab to that with addView(config), then the tab button will not change its color when selected. I made a snippet to show that. Switch to “Tab 2” and you will notice how the tab stays gray.

The issue seems to be that the tab button receives a wrong value for its button_id attribute. It’s “$layout1” when it should be “t2” (ID of the tab).

<div class="webix_item_tab" button_id="$layout1" role="tab" aria-selected="false" tabindex="-1" style="width:200px;">Tab 2</div>

I hope this helps.