Non unique view id

Hi, I have the following protoUI:

        webix.protoUI({
            name: "vistaTipoA",
            defaults: {
                rows: [
                    {
                        view: "layout",
                        id: "uno",
                        height: 250,
                        rows: [
                        ]
                    },
                    {
                        view: "layout",
                        id: "dos",
                        rows: [
                        ]
                    }
                ]
            },
            menu: function (elements) {
                this.getChildViews()[0].addView(elements);
            }
        }, webix.ui.layout, webix.IdSpace)

Then I try to create 2 views from “vistaTipoA”:

        var aux = webix.ui({
            id: winViewId,
            view: "vistaTipoA",
        });

        aux.menu(...);

        var aux1 = webix.ui({
            id: winViewId,
            view: "vistaTipoA",
        });

        aux1.menu(...);

I have the error: Non unique view id: uno

How I can fix?

Hi,

You cannot use the same “id” property in 2 views. You should remove “id: winViewId” property or use the different “id”.

In webix.protoUI function, you shouldn’t use specific “id” property too.

Please read: http://docs.webix.com/tutorials__start_coding.html

I use MVC with Razor support, I get around this with :smile:
id: “@{ Guid.NewGuid().ToString(); }”

For me the same. I’m sure that I have used a unique identifier for a ui id. But I’ll get always the error, non unique view id: random name!!
What’s the point? Did I miss something?

Thank you
Michael

changes: I found out this happens, when I load a webix.ui over ajax within a container construct than I got this unique id problem…

I mean how can I suppress this warning Non unique view id while loading this webix.ui in a container cause there are all id’s unique!

Thanl you