diff --git a/projects/valtimo/form-view-model/src/lib/components/form-view-model/form-view-model.component.html b/projects/valtimo/form-view-model/src/lib/components/form-view-model/form-view-model.component.html index dd6356e4c..eacca358b 100644 --- a/projects/valtimo/form-view-model/src/lib/components/form-view-model/form-view-model.component.html +++ b/projects/valtimo/form-view-model/src/lib/components/form-view-model/form-view-model.component.html @@ -43,6 +43,7 @@ [submission]="obs.submission" [form]="obs.form" [options]="obs.formioOptions" + [refresh]="refreshForm" (submit)="onSubmit($event)" (change)="onChange($event)" (focusout)="onBlur($event)" diff --git a/projects/valtimo/form-view-model/src/lib/components/form-view-model/form-view-model.component.ts b/projects/valtimo/form-view-model/src/lib/components/form-view-model/form-view-model.component.ts index 3c5475f36..6ef8a46f3 100644 --- a/projects/valtimo/form-view-model/src/lib/components/form-view-model/form-view-model.component.ts +++ b/projects/valtimo/form-view-model/src/lib/components/form-view-model/form-view-model.component.ts @@ -95,6 +95,7 @@ export class FormViewModelComponent implements OnInit { @Output() formSubmit = new EventEmitter(); public errors: string[] = []; + public refreshForm = new EventEmitter(); private _preventNextPage = false; private _preventPreviousPage = false; @@ -324,6 +325,7 @@ export class FormViewModelComponent implements OnInit { submission.data = viewModel; this.submission$.next(submission); this.handlePageChange(); + this.refreshForm.emit({submission: submission}); this.loading$.next(false); this.errors = []; }, @@ -386,6 +388,7 @@ export class FormViewModelComponent implements OnInit { submission.data = viewModel; this.submission$.next(submission); this.handlePageChange(); + this.refreshForm.emit({submission: submission}); this.loading$.next(false); this.errors = []; },