This is a migrated thread and some comments may be shown as answers.

Duplicate verification messages when switching between tabs

2 Answers 1107 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Ivan
Top achievements
Rank 3
Iron
Iron
Iron
Ivan asked on 23 Oct 2020, 05:17 PM

Hello!
I have a tabstrip with many tabs.
One of tabs contains validator like

<ValidationMessage For="@(() => crmView.Name)" />

 

If I switch between tabs, and return to the tab with validation, duplicate validation messages occur when switching between tabs.
How to prevent that?

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 23 Oct 2020, 06:03 PM

Hi Ivan,

We don't control the validation message store, the edit forms and edit contexts control it, so you may need to Clear() it yourself. Perhaps this thread can help you get started with that https://stackoverflow.com/questions/60917323/how-to-reset-custom-validation-errors-when-using-editform-in-blazor-razor-page, or this one https://blazor-university.com/forms/writing-custom-validation/. Or, maybe if the validation context is stored outside of the tab strip perhaps it should not be, or you could re-create it in the SelectedIndexChanged event.

 

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Ivan
Top achievements
Rank 3
Iron
Iron
Iron
answered on 23 Oct 2020, 07:11 PM
Thank you!
The simplest way is create new editcontext in ActiveTabIndexChanged event
Tags
TabStrip
Asked by
Ivan
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Marin Bratanov
Telerik team
Ivan
Top achievements
Rank 3
Iron
Iron
Iron
Share this question
or