RadComboBox is doing a double automatic postback when used with RadAjaxManager

5 posts, 0 answers
  1. Matthew R Longhouse
    Matthew R Longhouse avatar
    14 posts
    Member since:
    Apr 2007

    Posted 13 Mar 2014 Link to this post

    The RadComboBox control is posting back twice in the following scenario.

    -2 combo boxes
    -both configured in checkbox mode
    -both of which are configured to post back automatically
    -AJAXified using the RadAjaxManager control with the first combo box having the second as an updated control (changing the selection in combo box one updates the items in combo box 2)
    -empty message is set, oddly enough the problem doesn't happen when the empty message is not set

    I did some stepping through the Telerik client code and can see that a postback is done twice for the TextChanged event, once when the _selectItemOnBlur method is called (even though it is checkbox mode) and then again after that.  When the control is working normally it doesn't do the second postback.  The effect of the second postback causes a full postback while the first is a partial.  The problem doesn't start until after the second change to checked list.

    To reproduce:
    -check 1, 2, and 3 in the 2nd combo box and click off the combo box so that it posts back
    -uncheck 3 in the 2nd combo box and click off the combo box so that it posts back
    -at this point it should do 2 post backs as seen by putting a breakpoint in the ramAjaxManager_OnRequestStart event handler or in the code behind (one of which is actually not even detected as postback by ASP.NET)


    Controls version: 2013.2.717.40
    Browser tested: IE 11


    <telerik:RadAjaxManager ID="ramAjaxManager" ClientEvents-OnRequestStart="ramAjaxManager_OnRequestStart" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="ddlTestOne">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ddlTestTwo" />
                        <telerik:AjaxUpdatedControl ControlID="ltrTest" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="ddlTestTwo">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ltrTest" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        
        <telerik:RadComboBox ID="ddlTestOne" EmptyMessage="Test 1" CheckBoxes="True" OnSelectedIndexChanged="lstTestOne_OnSelectedIndexChanged" AutoPostBack="True" runat="server" />                        
        <telerik:RadComboBox ID="ddlTestTwo" EmptyMessage="Test 2" CheckBoxes="True" OnSelectedIndexChanged="lstTestTwo_OnSelectedIndexChanged" AutoPostBack="True" runat="server" />                        

        <asp:Literal ID="ltrTest" runat="server" />  


            protected void Page_Load(object sender, EventArgs e)
            {
                if (!IsPostBack)
                {
                    BindTestOneData();
                    BindTestTwoData();
                }
            }

            protected void lstTestOne_OnSelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
            {
                ltrTest.Text = String.Format("lstTestOne_OnSelectedIndexChanged: Old text: {0}, New text: {1}", e.OldText, e.Text);
            }

            protected void lstTestTwo_OnSelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
            {
                ltrTest.Text = String.Format("lstTestTwo_OnSelectedIndexChanged: Old text: {0}, New text: {1}", e.OldText, e.Text);
            }

            public void BindTestOneData()
            {
                ddlTestOne.DataSource = Enumerable.Range(1, 8).Select(r => new { Value = r, Text = r });
                ddlTestOne.DataValueField = "Value";
                ddlTestOne.DataTextField = "Text";
                ddlTestOne.DataBind();            
            }

            public void BindTestTwoData()
            {
                ddlTestTwo.DataSource = Enumerable.Range(1, 8).Select(r => new { Value = r, Text = r });
                ddlTestTwo.DataValueField = "Value";
                ddlTestTwo.DataTextField = "Text";
                ddlTestTwo.DataBind();
            }
  2. Aneliya Petkova
    Admin
    Aneliya Petkova avatar
    207 posts

    Posted 18 Mar 2014 Link to this post

    Hello Matthew,

    We have successfully reproduced the described unusual behavior. I have logged the issue for fixing by our developers.We will notify you in this thread when there is some update about this issue.
    For this bug report I am awarding you some Telerik Points, which you can see updated in your account profile.

    If you have questions or if you observe other unusual issues, please feel free to contact us again.

    Regards,
    Aneliya Petkova
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Aneliya Petkova
    Admin
    Aneliya Petkova avatar
    207 posts

    Posted 24 Mar 2014 Link to this post

    Hello,

    I am glad to inform you that the issue with RadComboBox is resolved and the fix will be available in Q1 2014 SP1,expected in the beginning of April.


    Regards,
    Aneliya Petkova
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
  5. Andreas Dahlén
    Andreas Dahlén avatar
    16 posts
    Member since:
    Mar 2010

    Posted 16 Jun 2014 in reply to Aneliya Petkova Link to this post

    We have the same problem with double postbacks. We've tried the Q1 release and the latest internal build.

    We have a RadAjaxPanel with a RadComboBox that does an autopostback.  When removing EmptyMesage it works fine, but not when we have EmptyMessage set.
  6. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 17 Jun 2014 in reply to Andreas Dahlén Link to this post

    Hi Andreas Dahlén,

    Unfortunately I couldn't replicate the issue at my end. Please have a look into the sample code snippet which works fine at my end. 

    ASPX:
    <telerik:RadAjaxPanel ID="rajaxpanelComboBox" runat="server">
        <telerik:RadComboBox ID="rcboTestItems" runat="server" AutoPostBack="true" EmptyMessage="select" OnSelectedIndexChanged="rcboTestItems_SelectedIndexChanged">
            <Items>
                <telerik:RadComboBoxItem Text="Item1" />
                <telerik:RadComboBoxItem Text="Item2" />
                <telerik:RadComboBoxItem Text="Item3" />
            </Items>
        </telerik:RadComboBox>
        <asp:Literal ID="ltrComboItem" runat="server" />
    </telerik:RadAjaxPanel>

    C#:
    protected void rcboTestItems_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        ltrComboItem.Text = "Selected Item Text is "+ e.Text;
    }

    Please provide your full code if it doesn't help.
    Thanks,
    Princy.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017