Custom Form Control not available in form.getValues()

Hi,
I am trying to develop a custom form control that will actually group several webix elements.

An example code could be :

webix.protoUI({
  name: "my_control",
  
  $init: function(config) {
    this.$view.className = "my_control";
    webix.ui(
      { view:"text", value:"blah", width:100 },
      this.$view);
  },
  
  getValue: function() {
    return "getValue";
  },
}, webix.ui.baseview);

My problem is that :

  • if I add this custom control into a form, its value (as returned
    by getValue() is not given by form.getValues())

  • if, however I make this component extend webix.ui.text (instead of webix.ui.baseview), its value is then given by form.getValues(); howver it will not be displayed correctly.

A working snippet that demonstrates my intention is available at http://webix.com/snippet/5a344236

I know I could be using

defaults : { template : function(config, common) { ...}}

but I do not want to write html by hand.
I want to use a group of webix components, and treat them as a custom control.

Is this feasible ?

Thanks in advance !

Hello,

The view must contain both getValue and setValue methods to be handled like form control.

Many thanks Maria !