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

Bug with inputType token

6 Answers 306 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
mathieu
Top achievements
Rank 1
mathieu asked on 08 Aug 2012, 10:52 PM
hi,

i'm experimenting an issue with a radautocompleteBox 
the rad autocomplete box is in a radwindow and when the radautocompletebox is in text mode it's working but in token mode the control is like disable i can't type anything in the textbox and there is no javascript error

here is the sample : 
<telerik:RadAutoCompleteBox runat="server" ID="RadAutoCompleteBox1" InputType="Token"
    Width="300px" DropDownWidth="300px">
    <WebServiceSettings Method="GetCompanyNames" Path="~/WebService.asmx" />
</telerik:RadAutoCompleteBox>

also this sample is working outside of the radwindow..
i don't really need the token mode but i need the event  OnClientEntryAdding so if you have a workaround or something :-).

thanks for your help 


6 Answers, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 09 Aug 2012, 04:08 PM
Hello Mathieu,

Thank you for pointing this issue to us. I have already created an item for it in our issue tracking system and we will do our best to provide a fix for it. Here is the link to the PITS item: http://www.telerik.com/support/pits.aspx#/public/aspnet-ajax/12239.

I have also updated the points in your telerik account.

Regards,
Ivana
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
mathieu
Top achievements
Rank 1
answered on 09 Aug 2012, 04:18 PM
thank you

do you have an idea of a workaround ?

in my case i can replace this autocompletebox by another functionnality but i don't know how to do 
i mean i can replace the autocomplete box by a text box and a listbox 
for this i need something like this :
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="autocompletebox" EventName="OnTextChanged">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="ListBoxSource" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<asp:TextBox runat="server" ID="autocompletebox" OnTextChanged="RadInput_TextChanged"
    AutoPostBack="true"></asp:TextBox>
    <br />
<telerik:RadListBox
    runat="server" ID="ListBoxSource"
    Height="350px" Width="260px"
    AllowTransfer="true" TransferToID="ListBoxDestination"
    AllowTransferOnDoubleClick="True" SelectionMode="Multiple">
</telerik:RadListBox>
    <telerik:RadListBox runat="server" ID="ListBoxDestination" Height="150px" Width="230px" />

but it's not working and i can't figure out why 

0
Ivana
Telerik team
answered on 10 Aug 2012, 01:59 PM
Hello Mathieu,

The following CSS style should fix the problem you experience when RadAutoCompleteBox is nested inside a RadWindow, and its TextMode is set to "Token":
.racInput{
    max-width: none !important;
}
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" ShowContentDuringLoad="true">
    <Windows>
        <telerik:RadWindow ID="RadWindow1" VisibleOnPageLoad="true" runat="server" Width="500px">
            <ContentTemplate>
                <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
                    ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM Authors" />
                <telerik:RadAutoCompleteBox runat="server" ID="RadAutoCompleteBox1" DataSourceID="SqlDataSource1"
                    DataTextField="AuthorName" DataValueField="ID" InputType="Token" AllowCustomToken="true"
                    Width="300px" DropDownWidth="300px">
                </telerik:RadAutoCompleteBox>
            </ContentTemplate>
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

I hope this will help.

Kind regards,
Ivana
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
mathieu
Top achievements
Rank 1
answered on 10 Aug 2012, 04:21 PM
thanks for the fix 
i tried it look like ok 
but i did with a little bit of javascript, a textbox and a listbox and it's nice :-)

thanks
0
Harish
Top achievements
Rank 1
answered on 13 Aug 2012, 01:38 PM
i used the following css
.racInput{
    max-width: none !important;
}

but still i have problem with RadAutoCompleteBox css when i add RadFormDecorator.

and how do i restrict adding duplicate values?

please check the attachment

Regards,
Harish P
0
Kalina
Telerik team
answered on 14 Aug 2012, 02:54 PM
Hello,

Thank you for contacting us.
Regarding the issue with RadFormDecorator - please take a look at this forum thread where it has been discussed in details.

Restricting the adding duplicate values is not currently supported out of the box.
However you can easily prevent users add same entry twice by handling the OnClientEntryAdding event in this way:
<script type="text/javascript">
 
function entryAdding(sender, eventArgs) {
    var entries = sender.get_entries(),
    count = entries.get_count();    
                   
    for (var i = 0; i < count; i++) {           
        if(entries.getEntry(i).get_value() == eventArgs.get_entry().get_value())
        {
            eventArgs.set_cancel(true);
        }
    }
}
</script>
 
<telerik:RadAutoCompleteBox runat="server" ID="RadAutoComplete1"  OnClientEntryAdding="entryAdding"
...
...
...


All the best,
Kalina
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
AutoCompleteBox
Asked by
mathieu
Top achievements
Rank 1
Answers by
Ivana
Telerik team
mathieu
Top achievements
Rank 1
Harish
Top achievements
Rank 1
Kalina
Telerik team
Share this question
or