Hi,
EditForm Save and Next buttons have to validate model and check if EditContext has been modified.
In an EditForm, in addition to a "Save" button (with type="submit"), there's a second button "Next". This "Next" button should do the following:
- check if model has been modified (using editContext.IsModified() maybe?)
- if yes, display SfDialog with "save" and "cancel" buttons.
- upon clicking "Save", validate model (maybe using editContext.Validate() ?)
- if validated then call SaveForm() method
- else just show form with validation message in model annotations
- "cancel" button should just close the SfDialog to show the form
- if no, redirect to another razor component.
Could you please propose an elegant solution for these form actions?