Open SteveSandersonMS opened 5 years ago
@SteveSandersonMS, how important is this to be done in 3.0? Can we do this post 3.0 without breaking customers?
@mkArtakMSFT Yes. Until we make built-in support, it would be extra work for developers to track the set of pending tasks associated with form validation so they can block submission until they are all done, but it is technically possible to do it.
@SteveSandersonMS, this issue is blocking using FluentValidation with Async Validators like http calls etc, which are crucial for complex validations. See this issue, https://github.com/Blazored/FluentValidation/issues/38
Do you have any guidance on how to fix this?
I would like the ability to perform some async action when the context is changed, at the moment I cannot use OnFieldChanged
without locking up my application during the async call.
Since this is not a built-in concept in EditContext
today, you'd need to write your own code to co-ordinate it. For example, during a form submission, you could start a set of async validation operations and display a "please wait" UI. When those operations complete, if you consider the validation to have passed you would run whatever save logic you need, or if you consider it to have failed, you would add some validation messages to the ValidationMessageStore
.
Thanks for contacting us.
We're moving this issue to the .NET 8 Planning
milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
@SteveSandersonMS How about making an async OnValidationRequested event handler in the EditContext? This way the HandleSubmitAsync method of the EditForm which is already async, could invoke and await an async form validation. This async form validation is in the end only triggered when the form is actually being submitted and not on each field changed event. Its then up to a custom validator component to notify the UI about an ongoing validation progress. I created a code example in issue #51501.
@SteveSandersonMS Any update on this?
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Asynchronous OnValidationRequested support would be good, especially now that we have Blazor static SSR. For apps where all forms are handled in this rendering model without interactivity, it would be beneficial.
Follows on from #7614
Design ideas:
Will implement this shortly after getting more of the system in place, assuming it still appears to be the correct design.