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

AutoCompleteBox problem with Single Selection Mode and Text Input Type

10 Answers 417 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 03 Oct 2013, 06:33 PM
Hi, I am using the AutoCompleteBox with the following configuration:

<telerik:RadAutoCompleteBox runat="server" ID="Recipient_RadAutoCompleteBox" AllowCustomEntry="true" TextSettings-SelectionMode="Single" Width="200px"  DataSourceID="Recipient_SqlDataSource"  DataTextField="Name" InputType="Text">
</telerik:RadAutoCompleteBox >

Everything works fine if the user types an entry that is not in the list, or if the user selects an item from the list and then hits the "Tab" or "Enter" key. The problem I'm having occurs when the user arrows down the list to highlight an entry or types in the same text as an existing entry, and then uses the mouse to put the focus on another field on the page. When that happens, the text shows in the AutoCompleteBox correctly, but on the server side there are no entries added to the Control and the .Text property is also empty. Please help.

10 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Oct 2013, 07:25 AM
Hi Jason,

Please have a look into the following code snippet that I tried to access the selected Item of RadAutoCompleteBox on RadButton OnClick event. I am not able to replicate the issue for me it is working fine.

ASPX:
<telerik:RadAutoCompleteBox runat="server" ID="Recipient_RadAutoCompleteBox" AllowCustomEntry="true"
    TextSettings-SelectionMode="Single" Width="200px" DataSourceID="SqlDataSource1"
    DataTextField="ContactName" InputType="Text">
</telerik:RadAutoCompleteBox>
<telerik:RadButton ID="RadButton1" runat="server" AutoPostBack="true" Text="CheckValue"
    OnClick="RadButton1_Click">
</telerik:RadButton>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
    SelectCommand="SELECT [ContactName] FROM [Customers]">
</asp:SqlDataSource>

C#:
protected void RadButton1_Click(object sender, EventArgs e)
{
    string value = Recipient_RadAutoCompleteBox.Text;
}

Please provide your full code if it doesn't help you.
Thanks,
Shinu.
0
Jason
Top achievements
Rank 1
answered on 04 Oct 2013, 12:05 PM
Nope still doesn't work for me. I noticed that it does work in IE but not in Chrome. For both browsers though, it does not work if I type the exact text of an existing entry and then mouse out of the field without hitting tab or enter. 
0
Jason
Top achievements
Rank 1
answered on 07 Oct 2013, 07:56 PM
Here is a test page that I setup to demonstrate the issue. Please test it multiple times in different browsers because it does work correctly sometimes:

ASPX:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="Deliverables_test" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title>test</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" ></telerik:RadScriptManager>
 
        <telerik:RadAutoCompleteBox runat="server" ID="test_RadAutoCompleteBox" AllowCustomEntry="true" TextSettings-SelectionMode="Single" Width="200px" InputType="Text"
             DataSourceID="test_SqlDataSource"  DataTextField="Name">           
        </telerik:RadAutoCompleteBox >
 
         <asp:SqlDataSource ID="test_SqlDataSource" runat="server"
                SelectCommand="Select Distinct C.ContactID, (C.FirstName + ' ' + C.LastName) as Name
                        from Contact C"
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" />
 
        <asp:Button ID="Submit_Button" runat="server" Text="Test" />
        <br /><br />
        Selected: <asp:Label ID="result_Label" runat="server"></asp:Label>
 
 
 
    </div>
    </form>
</body>
</html>


VB.NET:
Partial Class Deliverables_test
    Inherits System.Web.UI.Page
 
    Protected Sub Submit_Button_Click(sender As Object, e As EventArgs) Handles Submit_Button.Click
        result_Label.Text = test_RadAutoCompleteBox.Text
    End Sub
End Class
0
Nencho
Telerik team
answered on 08 Oct 2013, 11:25 AM
Hello Jason,

I tried to replicate the described behavior, but to no avail. I had prepared a sample project, base on the provided implementation. As suggested, I had tested several times the behavior, under different browser, but I am afraid that the result was the same - not replicated. Would you also give it a try at your end and let is know if I had missed something. It would be helpful, if you could record a video(using Jing), demonstrating the issue.

Regards,
Nencho
Telerik
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 RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Jason
Top achievements
Rank 1
answered on 08 Oct 2013, 12:55 PM
I downloaded your solution and it does the same thing. I even tested it on other machines to make sure it wasn't my computer. I recorded some videos to show you what its doing. Do I need to create a support ticket to upload them?
0
Jason
Top achievements
Rank 1
answered on 08 Oct 2013, 12:59 PM
I uploaded the videos to my screencast account. This one shows me typing in the text of an entry and then mousing out of the field:

http://www.screencast.com/t/8wn0bQtRcn


And this one shows me using the keyboard to highlight and entry and then mousing out of the field:

http://www.screencast.com/t/42BWh3nd5Cp
0
Nencho
Telerik team
answered on 11 Oct 2013, 08:34 AM
Hello Jason,

The provided video was helpful. After further attempt of replication of the issue - I was able to do so. I have already forwarded it to our developer team for further investigation. Thank you for pointing that out. Your Telerik Points are updated.

Regards,
Nencho
Telerik
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 RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Mari
Top achievements
Rank 1
answered on 23 Oct 2013, 10:13 AM
Hi,

I am also running into the same problem, using a RadAutoCompleteBox with LoadOnDemand, loading data from a web service.  On selecting an entry a postback is triggered but the entry list is empty.  For me pressing enter and tab after selection don't make any difference, the list is still empty.  What is strange, is that if I add a javascript function to handle the OnClientEntryAdded event, and put an alert pop-up in that function, then the entry list is filled. 

I'll be interested to hear if  you come up with a solution.

Thanks
 

0
Bozhidar
Telerik team
answered on 28 Oct 2013, 08:50 AM
Hi,

The original issue that Jason explained about mousing out of the AutoCompleteBox and the entries being empty has now been resolved, and the working version will be available in our next internal build, as well as the upcoming ServicePack.

As for your issue Mari, it seems to be a different one, so I suggest you open a support ticket and attach a sample project that we can inspect in order to troubleshoot it.

Regards,
Bozhidar
Telerik
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 RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Mari
Top achievements
Rank 1
answered on 01 Nov 2013, 12:10 PM
Hi,

In the process of setting up the example project I discovered what the problem was.  We were using a clientside script to trigger postback, which was called in the OnClientEntryAdded handler.  This was a holdover from when we used the RadComboBox and needed to trigger postback only under certain circumstances.  This is no longer the case so now I have simply registered a serverside function for OnEntryAdded, and the entries are passed through fine. 

Thanks
Tags
AutoCompleteBox
Asked by
Jason
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jason
Top achievements
Rank 1
Nencho
Telerik team
Mari
Top achievements
Rank 1
Bozhidar
Telerik team
Share this question
or