Problem with setValues() on form?

Hi,

Having a problem with code on http://webix.com/snippet/959d73ca, setValues() has no effect, and no error is output. What could be wrong?

Tks.

Same as with html form elements - you need to use “name” for data mapping, not “id”
http://webix.com/snippet/20542d11

Ah… got it, thanks!

Ok, one other thing… I guess I’m missing a setClean() method on the form, or something similar. If I set values this way, the form is marked dirty. I need a way to mark a form as clean after I change values via setValues(). Any hints?

Thanks.

Actually the setValues call marks form as “clean”. There is no need for extra command.
http://webix.com/snippet/ee35dadd

What about the behavior when using setvalues this way: http://webix.com/snippet/ba51b360

Problem caused by the “name” attribute on the button. It will be fixed in the next build.

As quick solution, if you need to set status of form to clean, you can use one of next solution

myform.clear();

or

myform.setValues(myform.getValues());

Got it. Thanks!!