Merge pull request #10136 from scmmishra/after-load-web-form
This commit is contained in:
commit
69fb2db5ec
1 changed files with 5 additions and 3 deletions
|
|
@ -29,7 +29,7 @@ export default class WebForm extends frappe.ui.FieldGroup {
|
|||
|
||||
// webform client script
|
||||
frappe.init_client_script && frappe.init_client_script();
|
||||
frappe.web_form.events.trigger('after_load');
|
||||
this.after_load && this.after_load();
|
||||
}
|
||||
|
||||
on(fieldname, handler) {
|
||||
|
|
@ -102,7 +102,9 @@ export default class WebForm extends frappe.ui.FieldGroup {
|
|||
}
|
||||
|
||||
save() {
|
||||
this.validate && this.validate();
|
||||
if (this.validate && !this.validate()) {
|
||||
frappe.throw(__("Couldn't save, please check the data you have entered"), __("Validation Error"));
|
||||
}
|
||||
|
||||
// validation hack: get_values will check for missing data
|
||||
let doc_values = super.get_values(this.allow_incomplete);
|
||||
|
|
@ -134,7 +136,7 @@ export default class WebForm extends frappe.ui.FieldGroup {
|
|||
if (!response.exc) {
|
||||
// Success
|
||||
this.handle_success(response.message);
|
||||
frappe.web_form.events.trigger('after_save');
|
||||
this.after_save && this.after_save();
|
||||
}
|
||||
},
|
||||
always: function() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue