ComboBox events disabled after validators fire

12 posts, 0 answers
  1. tjans
    tjans avatar
    27 posts
    Member since:
    Aug 2007

    Posted 24 Jul 2008 Link to this post

    I have a rather large form with textboxes and dropdowns, each with their own validator.  Based on several conditions, including the click of certain radiobuttons in this same form, validators are turned on or off and text boxes are hidden or displayed.  All of this is happening inside of a RadAjaxPanel. 

    I'm seeing a very frustrating issue where click one of the radio buttons to enable the validator for a few comboboxes and then click the save button to cause validation, the comboboxes stop responding to events.

    To try and isolate the problem, I have even included a combobox with no validator outside of the AjaxPanel to see if it would kill this as well, and it does.

    It does not look disabled (greyed out), so I attempted to catch the "OnClientDropDownOpening" event, and verified that before validation was fired the "OnClientDropDownOpening event fired, and then after causing validation again with the save button, the OnClientDropDownOpening was not being fired.

    I also just tested to see if how the validators fire effected this issue, and it does.  If I am on  textbox and I clear the text and tab off of it, it fires the validator for that textbox, but doesn't kill the ComboBox events.  If I cause validation for the whole page (via the save button), then it kills the droppdown events.

    Finally, I just removed the RadAjaxPanel from the whole page, and the problem went away.

    This is a very large piece of code, so I cannot effectively provide an example for you.  I was hoping Telerik, or perhaps another user might have run into this before. Thanks for your time...    
  2. Rosi
    Admin
    Rosi avatar
    2529 posts

    Posted 24 Jul 2008 Link to this post

    Hello ,

    Please find the attached project illustrating that everything works as expected at our side.

    Download it and find the differences at your side. Could you tell us how to reproduce the problem using the attached project?

    Regards,
    Rosi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. tjans
    tjans avatar
    27 posts
    Member since:
    Aug 2007

    Posted 24 Jul 2008 Link to this post

    There aren't really any more details I can give than what I've described above.  We use the RadAjaxPanel extensively, and haven't run into issues otherwise.  There's something in the firing of the validators that is breaking the ComboBox "open" event.

    If I remove the RadAjaxPanel, the ComboBox opens just fine, which is the strangest part to me.  Perhaps there is some conflict between the javascript that's getting rendered from the Panel vs. the ComboBox...
  4. Rosi
    Admin
    Rosi avatar
    2529 posts

    Posted 25 Jul 2008 Link to this post

    Hello ,

    Did you reproduce the issue with the project which I sent to you? If no could you modify it so the problem to exist in our project and send it back to us to test it locally?

    Regards,
    Rosi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. tjans
    tjans avatar
    27 posts
    Member since:
    Aug 2007

    Posted 30 Jul 2008 Link to this post

    Since I am seeing this in another set of code as well, and disabling the ajax panel is not an option, I will try to duplicate this in an isolated set of code and post it here.        
  6. tjans
    tjans avatar
    27 posts
    Member since:
    Aug 2007

    Posted 30 Jul 2008 Link to this post

    I have an isolated example project that you can use to verify the issue I'm seeing.  I don't see a file upload box, how can I attach this zip file to my post?
  7. tjans
    tjans avatar
    27 posts
    Member since:
    Aug 2007

    Posted 30 Jul 2008 Link to this post

    Here is the aspx page:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ComboBoxValidators._Default" %> 
     
    <%@ Register Assembly="Telerik.Web.UI, Version=2008.1.415.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" 
        Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    <html xmlns="http://www.w3.org/1999/xhtml" > 
    <head runat="server">  
        <title>Untitled Page</title> 
    </head> 
    <body> 
        <form id="form1" runat="server">  
        <div> 
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
            </telerik:RadScriptManager> 
              
            <ol> 
              <li>Click the "Show ComboBox" button.  This will turn the second div containing the combobox visible and the first div to invisible</li> 
              <li>Drop the combobox down, and you'll see it works correctly</li> 
              <li>Click the "Hide ComboBox" button and it will fire the validator (make sure you have the "Select..." item chosen so the validator fires)</li> 
              <li>Try to drop the ComboBox down and you'll see that it no longer drops down</li>   
            </ol> 
              
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">  
              
            <div id="FirstDiv" runat="server">  
            <asp:Button ID="ShowButton" runat="server" Text="Show ComboBox" OnClick="ShowButton_Click" /> 
            </div> 
              
            <div id="SecondDiv" runat="server" visible="false">  
            <telerik:RadComboBox ID="RadComboBox1" runat="server">  
              <Items> 
               <telerik:RadComboBoxItem Text="Select..." Value="" /> 
               <telerik:RadComboBoxItem Text="Item1" Value="Item1" /> 
               <telerik:RadComboBoxItem Text="Item2" Value="Item2" /> 
               <telerik:RadComboBoxItem Text="Item3" Value="Item3" /> 
             </Items>   
            </telerik:RadComboBox> 
              
            <asp:RequiredFieldValidator ID="Validator1" runat="server" ControlToValidate="RadComboBox1" text="*" InitialValue="Select..." Display="dynamic" /> 
              
            <asp:Button ID="HideButton" runat="server" Text="Hide ComboBox" OnClick="HideButton_Click" /> 
            </div> 
              
            </telerik:RadAjaxPanel> 
        </div> 
        </form> 
    </body> 
    </html> 
     

    Here is the code-behind:
    using System;  
    using System.Data;  
    using System.Configuration;  
    using System.Collections;  
    using System.Web;  
    using System.Web.Security;  
    using System.Web.UI;  
    using System.Web.UI.WebControls;  
    using System.Web.UI.WebControls.WebParts;  
    using System.Web.UI.HtmlControls;  
     
    namespace ComboBoxValidators  
    {  
        public partial class _Default : System.Web.UI.Page  
        {  
            protected void Page_Load(object sender, EventArgs e)  
            {  
     
            }  
     
            protected void ShowButton_Click(object sender, EventArgs e)  
            {  
                SecondDiv.Visible = true;  
                FirstDiv.Visible = false;  
            }  
     
            protected void HideButton_Click(object sender, EventArgs e)  
            {  
                SecondDiv.Visible = false;  
                FirstDiv.Visible = true;  
            }  
        }  
    }  
     
  8. tjans
    tjans avatar
    27 posts
    Member since:
    Aug 2007

    Posted 30 Jul 2008 Link to this post

    I should also mention that even if there is no validator on the ComboBox, other validators firing (e.g., a validator for another textbox field) still break the ComboBox functionality in this scenario.
  9. Rosi
    Admin
    Rosi avatar
    2529 posts

    Posted 30 Jul 2008 Link to this post

    Hi ,

    I suggest you log in to your account page and open a support ticket from New Support Ticket page.

    Then you can attach the project to the support message and send it to us.

    Kind regards,
    Rosi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. Steve Napurano
    Steve Napurano avatar
    40 posts
    Member since:
    Aug 2009

    Posted 20 Sep 2011 Link to this post

    Hi has this been resolved? If so can someone tell em how?

    I have combo box on a page, NO validators for the combobox. Other controls on page have validators. When user selects a value from the combobox, the validators for the OTHER controls fire. I set autopostback="true" for the combobox and I have causesvalidation on combobox set to false...

    I also have a selectedindexchanged event for combo on server side

    Strange

    note - ALL controls on page are Telerik controls...

    Thanks

    Steve
  11. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1268 posts

    Posted 23 Sep 2011 Link to this post

    Hello Steve,

    I've made a sample page with RadComboBox and couple of RadTextBoxes trying to reproduce the experienced issue, but to no avail. I'm using the current official version of the controls.

    In case you are using the latest version of the controls and still experiencing such issue, open a support ticket and provide a runnable sample page so we could examine it locally.

    All the best,
    Dimitar Terziev
    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
  12. Simone
    Simone avatar
    34 posts
    Member since:
    Mar 2011

    Posted 21 Nov 2011 Link to this post

    Had a similar issue. My radcomboxes got locked after Page.Validate fired. I solved the problem by using regular asp panel insteal of RadAjaxPanel .
Back to Top