Popups inside protoUIs

I have a type of panel that I created via protoUI(). Inside this panel, I have the following component (icon + popup):

http://webix.com/snippet/01061044

When I add a single panel (let’s call it custompanel), everything works fine. When I add the second custompanel, the panel itself is perfectly fine (addView({view:‘custompanel’, isolate:true})) but the when I try to open the popup, it claims that the ID is not unique. The ID it’s referring to is the popup’s body. I’ve tried using isolate:true on the popup as well but the error still occurs.

I’ve tried replicating the problem in Code Snippet but instead of throwing an error, it just seems that both icons open the same popup (check an item in one popup and the same item will be check in the other popup)

http://webix.com/snippet/59ed2345

You code is technically correct, but due to some specific of popup creation it doesn’t work as expected

The more safe way will be to move the sub-ui config from “defaults” into the $init method, so each new component will have separate object

http://webix.com/snippet/ab887d8d

And how does one get the values from the components inside the popup now?

Since there are multiple of those popups about, I can’t just use $$(‘popup_id’). I’ve tried using $$(‘customthing_id’).$$(‘popup_id’) but nothing.

Another important detail is that I need to be able to read and manipulate the components inside the popup before the user opens it for the first time. I might need to instantiate it outside the icon’s config, right?

Check the updated snippet

http://webix.com/snippet/195716b9

using webix.ui for popup in the constructor will ensure that popup is already created and can be manipulated. Using IdSpace works the same as isolate, but will include the popup in the isolated scope as well.

As more simple alternative, you can just add getValue ( and setValue ) helpers to your custom view

http://webix.com/snippet/d8c67d4d