-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form is rendering before data submission is ready #5929
Comments
I've found workaround for this, you can use evalContext property for configuration, and pass via it anything you want to be available for form in runtime. In this scenario u can pass evalContext: { and then you can use initData like for exmaple data for custom default value maybe that will suits for you |
I've already tried this method but it won't fully work since it won't validate in the backend when the data is sent to nodejs |
ahh, so good luck with finding other way :/ |
Can you provide a jsfiddle or some sort of code sandbox to illustrate what you are trying to do? |
This is a duplicate of #3687 |
I'm using formio with Angular,
Then I'm creating a form with a component that in advanced logic as javascript trigger condition that uses a var owner = data.OWNER; that depends on data.
When the form is created in angular with
Formio.createForm(
document.getElementById('formio'),
this.form,
options,
).then((form) => {
form.submission = this.formioSubmission;
}
The data arrives if i display a console.log but the console log prints multiple times undefined before gettings its value since the form is being rendered and the data is then loaded at the submission so the owner = data.OWNER; executes before the data is available.
Is there a better approach to use the data of the form or to wait until the form is rendered or is it a bug?
Version/Branch
Formiojs: 4.21.4
Formio/angular: 7.0.0
Expected behavior
Getting the data values before JavaScript in logic trigger is loaded.
The text was updated successfully, but these errors were encountered: