Hi, I have table on the left side with list of records and Form on right side for details and changes. What is the best way that when I want to Add new record the Form is empty for data entry?
TIA,
Stane
Hi, I have table on the left side with list of records and Form on right side for details and changes. What is the best way that when I want to Add new record the Form is empty for data entry?
TIA,
Stane
Hello @Karlek!
Do you think this solution could work for you?
The only way Ive found to “reset” or clear form data is to create an action that manually iterates all the components of the form and sets the values to a “start” state, ie: textField1.value=“” and so on. Some frameworks have the ability to iterate over a collection fo all the controls on a form and do some such action based on a switch or introspection to do whats needed for a specific type of control but I havent found that in UIB.
One of the easiest ways to reset a form is to pass an empty object.
{{ui.form.setValue({})}}
Same goes for setting the values
{{ui.form.setValue({
id: 1,
name: "test"
})}}
Every value that is not present in the passed object will be reset