RadComboBox Loop Issue - Client Side Programming - Changing SelectedValues

1 posts, 0 answers
  1. Majid Darab
    Majid Darab avatar
    112 posts
    Member since:
    Dec 2009

    Posted 20 Jul 2011 Link to this post

    hi dear telerik team :
    my 2 radcomboboxes codes is like below :

    <telerik:RadComboBox ID="RadcbCustomersEmail" runat="server" DataSourceID="sdsCustomers"
        DataTextField="Email" DataValueField="ID" EnableEmbeddedSkins="false" Skin="VistaByMe"
        ValidationGroup="A" Width="244px" CausesValidation="False"
        MaxHeight="150px" AppendDataBoundItems="True" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged_RadcbCustomersEmail">
        <Items>
            <telerik:RadComboBoxItem runat="server" Text="plz choose..."
                Value="-1" />
        </Items>
    </telerik:RadComboBox>
     
     
    <telerik:RadComboBox ID="RadcbCustomersMobile" runat="server" DataSourceID="sdsCustomers"
        DataTextField="Mobile" DataValueField="ID" EnableEmbeddedSkins="false" Skin="VistaByMe"
        ValidationGroup="A" Width="244px" CausesValidation="False"
        MaxHeight="150px" AppendDataBoundItems="True" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged_RadcbCustomersMobile">
        <Items>
            <telerik:RadComboBoxItem runat="server" Text="plz choose..."
                Value="-1" />
        </Items>
    </telerik:RadComboBox>

    and javascript codes :

     
    function OnClientSelectedIndexChanged_RadcbCustomersEmail(sender, eventArgs) {
        var MobileCombo = $find("<%= RadcbCustomersMobile.ClientID %>");
        var ComboItem = MobileCombo.findItemByValue(sender.get_selectedItem().get_value());
        MobileCombo.trackChanges();
        if (ComboItem != null)
            ComboItem.select();
        MobileCombo.commitChanges();
    }
     
    function OnClientSelectedIndexChanged_RadcbCustomersMobile(sender, eventArgs) {
        var EmailCombo = $find("<%= RadcbCustomersEmail.ClientID %>");
        var ComboItem = EmailCombo.findItemByValue(sender.get_selectedItem().get_value());
        EmailCombo.trackChanges();
        if (ComboItem != null)
            ComboItem.select();
        EmailCombo.commitChanges();
    }


    my syntax is ok , but i have a logical error about these codes / it seems there is a loop here / how can i prevent this loop?

    thanks in advance
    best regards
Back to Top