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

[Solved] Autocomplete not retrieving values as expected

3 Answers 168 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.
Roatin Marth
Top achievements
Rank 1
Roatin Marth asked on 20 Apr 2011, 04:03 PM
Using Ajax binding with client caching enabled (the default), the AutoComplete control shows wrong matches when typing a subset of a previously typed value.

  1. Quickly type some multi-char text, eg "al". The Quickly part is to ensure a single ajax request instead of one per char typed.
  2. Backspace to clear the field.
  3. Type only a subset of what was typed in step 1, eg "a"

Expected result: show all items that start with "a" (eg "Alice Mutton", "Aniseed Syrup")
Actual result: only shows items that start with "al" (eg only "Alice Mutton")

Demo available at http://demos.telerik.com/aspnet-mvc/combobox/ajaxloading (under "AutoComplete").

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 21 Apr 2011, 01:23 PM
Hello Roatin,

 
The described behavior is actually expected.

When end user quickly types "al" then only words which starts with "al" will be returned from the server. When caching is enabled then the AutoComplete will try to find matching word from the current data. Hence if user types "a" the autocomplete will find a matching word from the current data and will not make another request. 

In order to avoid this behavior you can turn off the caching of the autocomplete. The other option is to filter data by first letter of the input value. Thus the autocomplete will be able to still not make additional Ajax requests and show correct result after filtration.

Regards,
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
Roatin Marth
Top achievements
Rank 1
answered on 25 Apr 2011, 05:44 PM
The difference between working (getting all "a" items) and not working (getting only "al" items) is less than 200 milliseconds

User's generally don't keep track of how long it takes them to type. When the control shows matches for one person that are different than another person who happened to type < 200 ms slower/faster, then we get what's described in the industry as "unexpected behavior".

Please fix this.
0
Georgi Krustev
Telerik team
answered on 26 Apr 2011, 11:54 AM
Hello Roatin Marth,

 
Please excuse me if I am not understanding your statement correctly.

The mentioned "200 miliseconds" are fully adjustable. If you want to return result faster or slower you will need to use Delay method. I am not sure what should be fixed in the component as this functionalities are fully adjustable.

As to the filtering of the combobox you should disable caching of the component.

Here is a code snippet showing what I mean:

<%= Html.Telerik().ComboBox()
                .Name("AjaxComboBox")
                .AutoFill(true)
                .DataBinding(binding => binding.Ajax()
                                               .Select("_AjaxLoading", "ComboBox")
                                               .Cache(false)
                                               .Delay(400))
                .Filterable(filtering =>
                {
                    filtering.FilterMode(AutoCompleteFilterMode.StartsWith);
                })
                .HighlightFirstMatch(true)
        %>

Let me know if I am missing something.

Regards,
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
Tags
ComboBox
Asked by
Roatin Marth
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Roatin Marth
Top achievements
Rank 1
Share this question
or