Bug with inputType token

7 posts, 0 answers
  1. Mathieu
    Mathieu avatar
    20 posts
    Member since:
    Jun 2012

    Posted 08 Aug 2012 Link to this post

    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 


  2. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 09 Aug 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mathieu
    Mathieu avatar
    20 posts
    Member since:
    Jun 2012

    Posted 09 Aug 2012 Link to this post

    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 

  5. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 10 Aug 2012 Link to this post

    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.
  6. Mathieu
    Mathieu avatar
    20 posts
    Member since:
    Jun 2012

    Posted 10 Aug 2012 Link to this post

    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
  7. Harish
    Harish avatar
    11 posts
    Member since:
    Mar 2012

    Posted 13 Aug 2012 Link to this post

    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
  8. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 14 Aug 2012 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017