angular icon indicating copy to clipboard operation
angular copied to clipboard

Loading button not stop when i call success or error

Open KP-story opened this issue 6 years ago • 5 comments

i notify to formio submit success or error but loading button not stop. my code bellow


export class FormioViewComponent implements OnInit {

  @Input() formDescription;
  @Input() submission:any;
   private fireSubmitSuccess: EventEmitter<String > = new EventEmitter();
   private fireSubmitFailed: EventEmitter<String > = new EventEmitter();

   @Output() submit :EventEmitter<any> = new EventEmitter();
  constructor() { }

  submitDone()
  {
 
     this.fireSubmitFailed.next("Thanh cong");
console.log("submit done");
  }
  ngOnInit() {

  }

}

<formio [success]="fireSubmitSuccess" [error]="fireSubmitFailed"[form]="formDescription" (submit)="submit.emit($event) ; submitDone();" [submission]="submission"></formio>

KP-story avatar Jun 30 '19 13:06 KP-story

This is a known issue that we are looking into.

travist avatar Jul 01 '19 14:07 travist

I am having the same issue but Im just using the default submit event. It says submission complete but the submit loading icon doesn't go away. In the component.ts file, i just have a console.log for (submit)=onSubmit($event}.

image

sabinayakc avatar Sep 30 '19 17:09 sabinayakc

@travist - Facing same issue. Any solution on this issue would be helpful!!

nprla3s avatar Jan 21 '20 10:01 nprla3s

Hi guys, we're facing this same issue almost 4 years later, do you have any update about this topic??????

VitorCoS avatar Aug 14 '23 11:08 VitorCoS

Not sure when this was introduced, but now we have submitDone directive to notify the formIO that the submission is done.

<formio [form]="formIoObj"
                [submitDone]="submissionDone"      <<<-----<<<<
                [options]="formioOptions"
                (submit)="submit($event)" ></formio>
@Component(...)
export class PreviewComponent {

 @Output()
  submissionDone = new EventEmitter<Boolean>();

  async submit(formSubmission?: FormioSubmission) {
    console.log(object);
    // Submit to your backend
    this.submissionDone.emit(true). // Set to true to notify submission is complete.
  }

https://github.com/formio/angular/assets/17984781/768a0532-93ff-4931-bd95-22da85627430

P.S you should use the error directive when there are errors.

dinbtechit avatar Feb 03 '24 14:02 dinbtechit

Thanks for the contribution @dinbtechit I'm going to go ahead and close this as resolved.

lane-formio avatar Jul 22 '24 14:07 lane-formio

For me, at Angular 17, EventEmitter needs to be any as type. Boolean has crashed.

@Output() submissionDone = new EventEmitter<any>();

avmesquita avatar Aug 08 '24 15:08 avmesquita

Thanks for the contribution @dinbtechit I'm going to go ahead and close this as resolved.

Please, update wiki at https://github.com/formio/angular/wiki/Form-Renderer with this parameter.

avmesquita avatar Aug 08 '24 16:08 avmesquita

A ticket has been created to get this updated. Internal reference: FID-220

Sidiro23 avatar Sep 11 '24 13:09 Sidiro23