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

[Solved] OnChange() Event Problem

10 Answers 181 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
scorpionjade
Top achievements
Rank 1
scorpionjade asked on 29 Aug 2010, 12:07 PM
Hi,

I'm using the AutoComplete component. I declared a function to OnChange event.

My problem is the function is triggered twice, when I select a value from the AutoComplete list.

This is because the textbox is raising OnChange event when I type for example "tele", and it is raising the OnChange event when the textbox is filled automatically from the list I choose "Telerik Inc."

Is there a workaround for this?

Thank you

10 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 30 Aug 2010, 07:39 AM
Hello scorpionjade,

You are probably using an older version. Please try upgrading to 2010.2.825

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
scorpionjade
Top achievements
Rank 1
answered on 30 Aug 2010, 11:35 AM
My version is up to date. I'm on 2010.2.825 version.
0
Atanas Korchev
Telerik team
answered on 30 Aug 2010, 01:25 PM
Hi scorpionjade,

I tried to reproduce this problem in our client-events online example. I tried the following
  1. Focus the autocomplete
  2. Type in "Ch". The OnChange event is not raised.
  3. The suggestion box opens
  4. I pick the first suggestion 'Chai' by clicking it with the mouse
  5. Then the 'OnChange' event is raised

Can you reproduce this problem in the online example? If yes - how? If not - how is your setup different? Could you provide a sample project?

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
scorpionjade
Top achievements
Rank 1
answered on 30 Aug 2010, 07:31 PM
Hi Atanas,

Please redo your steps without typing something that is not included in list. For example type "22".
I tried that also in client-events online example page. OnChange event is not firing.
There are only two messages: Autocomplete is binding. Autocomplete is bound. No Onchange or value message.


Thank you
0
Georgi Krustev
Telerik team
answered on 31 Aug 2010, 08:39 AM
Hi scorpionjade,

AutoComplete UI component will raise change event  in some cases:
  • User clicks item from drop-down list.
  • User select item from drop-down list and clicks enter
  • User type text, not part of the drop-down list and blurs input HTML element.

With all this said, change event will be raised when input element blurs, if the typed text is custom.

All the best,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
scorpionjade
Top achievements
Rank 1
answered on 31 Aug 2010, 10:05 AM
Hi Georgi,

"User type text, not part of the drop-down list and blurs input HTML element."

As I said before, I visited the online example page:
http://demos.telerik.com/aspnet-mvc/combobox/clientsideevents

I typed "22" into the autocomplete textbox, and I blurred the textbox.
But no OnChange event message is displayed.

Please try it yourself.

In my opinion there's some error with the OnChange event. It is not working stable.

Thank you.
0
scorpionjade
Top achievements
Rank 1
answered on 02 Sep 2010, 01:32 PM
Any explanation on this issue please?

Thank you
0
Georgi Krustev
Telerik team
answered on 02 Sep 2010, 05:49 PM
Hi scorpionjade,

Thank you for drawing our attention to this issue.

I confirm it as a bug, which will be fixed in next official release of Telerik Components for ASP.NET MVC.

I have updated your Telerik points.

Sincerely yours,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Dan
Top achievements
Rank 1
answered on 22 Mar 2012, 03:06 AM
Hello Georgi, 

It seems like an old post, but I understood you had confirmed the problem with the OnChange client event for AutoComplete (ComboBox and dropDownList the same as they're using the same script) as a bug and mentioned then that it will be fixed in following release.

Seems like even today we have the same problem and we're using the latest version of asp.net mvc extensions.

In our project, we have a telerik grid with inline edit mode and one of  the columns is bound to a dropdownlist in edit mode.
We have an EditorTemplate for  that column, which has a definition for telerik dropdownlist with client event OnChange defined.

However, the event firing only once - when we clicking on edit button to enter the edit mode. Any change of the value inside dropdownlist, doesn't fie an OnChange event.

Could you, please, have a look into it and propose a solution for that problem.

Thank you,
Dan
0
Georgi Krustev
Telerik team
answered on 23 Mar 2012, 04:47 PM
Hello Dan,

 
I was not able to reproduce the depicted issue. Check this screencast and let me know if I am missing something.

Greetings,
Georgi Krustev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
ComboBox
Asked by
scorpionjade
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
scorpionjade
Top achievements
Rank 1
Georgi Krustev
Telerik team
Dan
Top achievements
Rank 1
Share this question
or