diff --git a/fragments/form/template.vue b/fragments/form/template.vue index e81af02e..ce24094d 100644 --- a/fragments/form/template.vue +++ b/fragments/form/template.vue @@ -27,6 +27,7 @@ export default { props: ['model'], data() { + console.log('success successpage1', this.model.successpage); return { formModel: {}, formOptions: { @@ -70,7 +71,11 @@ export default { form: this.formModel }) .then( (response) => { - $peregrineApp.loadContent(this.model.successpage) + if (this.model.successpage) { + $peregrineApp.loadContent(this.model.successpage) + } else { + window.dispatchEvent(new CustomEvent('form-clear',{})); + } }) .catch( (error) => { Vue.set(this, 'failureText', this.model.failmessage); diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/form/template.vue b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/form/template.vue index e81af02e..345fc454 100644 --- a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/form/template.vue +++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/form/template.vue @@ -70,7 +70,11 @@ export default { form: this.formModel }) .then( (response) => { - $peregrineApp.loadContent(this.model.successpage) + if (this.model.successpage) { + $peregrineApp.loadContent(this.model.successpage) + } else { + window.dispatchEvent(new CustomEvent('form-clear',{})); + } }) .catch( (error) => { Vue.set(this, 'failureText', this.model.failmessage);