You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We implemented formio within our own system, each form has a permission level that can be updated, therefore when we have a main form that has another form as subform using the "nested form" component, it is possible that in the future, the subform becomes inaccessible because of a change in permissions or if someone else deletes the subform, therefore when our user renders the main form he won't be able to load the subform.
Currently, if a nested form fails to load, formio renders the string "loading..." forever. No error handling is available whatsoever which can make the form look awkward. Examples at the end.
Describe the solution you'd like
There is 2 part to the solution:
1- A better way to display an error when a subform cannot be loaded. A default behavior could be implemented and the error rendering could be customizable from the edit form of a nested form or dynamically set from a callback passed to the rendering options.
2- A way to know if a subform failed to load when rendering the form, something like a callback that could be set in the options when rendering a form, for example.
Having a way to know which form failed to load and even receive the error from the fetch would be great since it could let us change the error message dynamically depending on the reason why loading the subform failed.
Describe alternatives you've considered
We could try to parse the source of the form being rendered and replace all nested form components that have subforms that cannot be rendered. However this does not take into consideration nested forms that themselves have other nested forms.
Additional context
Result:
for solution # 1:
In the form, instead of just loading, it could be an standard alert from bootstrap
There could be a standard error message, or the error message could be set from the nested form edit form, or even from a callback that is passed to the options.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
We implemented formio within our own system, each form has a permission level that can be updated, therefore when we have a main form that has another form as subform using the "nested form" component, it is possible that in the future, the subform becomes inaccessible because of a change in permissions or if someone else deletes the subform, therefore when our user renders the main form he won't be able to load the subform.
Currently, if a nested form fails to load, formio renders the string "loading..." forever. No error handling is available whatsoever which can make the form look awkward. Examples at the end.
Describe the solution you'd like
There is 2 part to the solution:
1- A better way to display an error when a subform cannot be loaded. A default behavior could be implemented and the error rendering could be customizable from the edit form of a nested form or dynamically set from a callback passed to the rendering options.
2- A way to know if a subform failed to load when rendering the form, something like a callback that could be set in the options when rendering a form, for example.
Having a way to know which form failed to load and even receive the error from the fetch would be great since it could let us change the error message dynamically depending on the reason why loading the subform failed.
Describe alternatives you've considered
We could try to parse the source of the form being rendered and replace all nested form components that have subforms that cannot be rendered. However this does not take into consideration nested forms that themselves have other nested forms.
Additional context
Result:
for solution # 1:
In the form, instead of just loading, it could be an standard alert from bootstrap
There could be a standard error message, or the error message could be set from the nested form edit form, or even from a callback that is passed to the options.
The text was updated successfully, but these errors were encountered: