issue with webix.protoUI

try to modify the exist richselect

webix.protoUI({
    name: "richselect",
    say_setter: function(value) {
        webix.message("Hello " + value);
    }
}, webix.ui.richselect);

and define ui

// that will display a message "Hello John"
webix.ui({
    view: "form",
    elements: [{
        view: "richselect",
        say: "John"
    }, {
        view: "combo",
        say: "John"
    }]
});

http://webix.com/snippet/02919e0a

but, if I revert the order of form elments, combo first then richselect, that will not display message

// will not disaply a message
webix.ui({
    view: "form",
    elements: [ {
        view: "combo",
        say: "John"
    },{
        view: "richselect",
        say: "John"
    }]
});

http://webix.com/snippet/8226cb03

why?

It is caused by a lazy nature of webix.protoUI, it doesn’t create the new UI, while it was not used. So, when you have modifications, for webix.ui.richselect, they will not be applied while richselect is not used on the page.

If you want to force the applying of modifications,t try to use the code like next

webix.protoUI({
    name: "richselect",
    say_setter: function(value) {
        webix.message("Hello " + value);
    }
}, webix.ui.richselect);

webix.ui.richselect.call(webix);

Originally, the protoUI API was designed for creating new components, its ability to modify the existing one is kind of side effect and has some limitations.

Thank you!