Closed Desteel closed 5 years ago
The set and get methods are intended to be used the with the original filed properties. (I don't know if I will change this behavior in the future).
I think you can create new methods to set and get the new property.
Thank you. Will such an implementation be valid?
export class ExtendedForm extends Form {
@observable public submitError: boolean = false;
public options() {
return { //... };
}
public hooks() {
return {
onSuccess: (form: Form) => {
this.submitError = false;
},
onError: (form: Form) => {
this.submitError = true;
}
};
}
}
you can do that but you have isValid
/hasError
properties already defined in the form object.
Hi! I need to display error messages after press submit button with option
showErrorsOnInit: true
.I did not find a way to change the properties of the fields in Form Hooks and added custom property via extended Field Class. I see my custom props it in the
console.log(field)
output, but I cannot change my custom props and set through form methods. I get this errorsPossible Unhandled Promise Rejection (id: 0): Error: The selected property is not allowed (["submitError"])
Can you tell me please, how can I do it?
I try this
and this
or
And in extended Form Class