angular icon indicating copy to clipboard operation
angular copied to clipboard

[Question] Event Emitter not firing

Open GleytonLima opened this issue 5 years ago • 7 comments

Hello, i make a stackblitz example to see Outputs/Events (https://github.com/formio/angular-formio/wiki/Form-Renderer#outputs-events) in action.

https://stackblitz.com/edit/angular-formio-ovgltx

But some events appears not be firing, like (invalid), (formLoad), (errorChange).

In addition, in the first (change) event, the value isValid is true, but the form actualy is invalid, because component 'name' is required.

Maybe I'm missing something to make it work properly?

GleytonLima avatar Jun 04 '20 19:06 GleytonLima

@GleytonLima Any progress on this? We've noticed similar behavior?

JRiggenbach avatar Jun 18 '20 18:06 JRiggenbach

@JRiggenbach for now i'm using only the onChange and Submit events. For workaround, after load the form i assume It as invalid (disabling my custom Button "Save") and checking If is valid only after some change. That way i dont need to use the "Invalid" event.

GleytonLima avatar Jun 27 '20 12:06 GleytonLima

@JRiggenbach for now i'm using only the onChange and Submit events. For workaround, after load the form i assume It as invalid (disabling my custom Button "Save") and checking If is valid only after some change. That way i dont need to use the "Invalid" event.

How do you check if it is valid ?

mdiazp avatar Aug 14 '20 00:08 mdiazp

Hi team! Any solution about this? I am in the same situation. I used a workaround, and I am forcing the user to make any change in the form in order to know if the form is valid or not. And, another issue is that when the event is fired the first time, the form is not valid, but is coming valid on the event.

dennitorf avatar Sep 14 '20 19:09 dennitorf

@JRiggenbach for now i'm using only the onChange and Submit events. For workaround, after load the form i assume It as invalid (disabling my custom Button "Save") and checking If is valid only after some change. That way i dont need to use the "Invalid" event.

I tried with this approach, but , the custom event for save is triggering twice. You faced this issue?

dennitorf avatar Sep 24 '20 17:09 dennitorf

@JRiggenbach for now i'm using only the onChange and Submit events. For workaround, after load the form i assume It as invalid (disabling my custom Button "Save") and checking If is valid only after some change. That way i dont need to use the "Invalid" event.

I'm also wondering how to check if the form is valid. Currently when I make a change in one of my fields that triggers a validation error (required for example), the form in no way indicates that it is Invalid other than the message under the field with an error. I should mention this is with Custom Components.

SGhantous avatar Oct 28 '20 19:10 SGhantous

Hi everyone, I'm stuck at the same point trying to emit events. I need to emit editGridSaveRow, so far this is working

<formio [form]="form" [submission]="submission"

but when I try adding this (editGridSaveRow)="test()" it's not, what I'm missing? any help would be welcomed, thanks

alexrok21 avatar Nov 03 '21 12:11 alexrok21

Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!

ZenMasterJacob20011 avatar Feb 07 '24 14:02 ZenMasterJacob20011