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

How do I reset combobox after custom validation?

1 Answer 81 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Veteran
Scott asked on 27 May 2020, 03:21 PM

I have some custom validation that has some complicated business rules so I put them all in a function.

On my combobox change event I call the validation function, if it returns true I save the record back to the database and it gets added to the combo.

But if this fails I want to blank out the combo and set focus to it, I have this part all working, the issue I have is that the change event doersn't get triggered the next time they enter the same value.

 

Example: 

1)User types in "Invalid" in the combo, this fails validation so it blanks it out and sets focus

2)If user types in anything OTHER than 'Invalid' then it works as it should, the change event triggers and it executes the logic

3)But if user types 'Invalid' again, it doesn't trigger the change event, it is remembering that value even though it was blanked out.

 

How do I reset the combo so that anything they type in will trigger the change event?

 

1 Answer, 1 is accepted

Sort by
0
Aleksandar
Telerik team
answered on 01 Jun 2020, 10:29 AM

Hello Scott,

The provided information was not enough for me to reproduce the behavior. Could you please share details on the implementation of the resetting the widget value? Note that if you use the value() method the change event is not triggered by the method and this might affect MVVM binding.

I created a sample dojo while testing the reported behavior. Could you please update it with the change event logic so the issue is reproducible and provide steps for reproducing the behavior? this way I can review and provide a further suggestion.

Regards,
Aleksandar
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
ComboBox
Asked by
Scott
Top achievements
Rank 1
Veteran
Answers by
Aleksandar
Telerik team
Share this question
or