Launching a Radwindow hides all dropdowns in parent page

8 posts, 0 answers
  1. Dan Appleyard
    Dan Appleyard avatar
    6 posts
    Member since:
    Jan 2010

    Posted 25 Jun 2010 Link to this post

    When launching a modal radwindow in IE 6, any dropdown's visible on the parent page are hidden.  Once they are hidden, they are gone even after the modal has been closed.  These are pure ASP.NET dropdownlists.  There is nothing special about the dropdown's that are hidden - I can add new dropdowns to the page with nothing in them, and they still go away on launch.  Any ideas out there?

    Thanks

    Dan Appleyard
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 29 Jun 2010 Link to this post

    Hi Dan,

    Do you use RadWindow for ASP.NET (RadWindow 1.x) or RadWindow for ASP.NET AJAX?

    If you work with RadWIndow 1.x, you could use the following JavaScript code to avoid the problem (make sure that it is placed after RadWindowManager's declaration:
    RadWindowNamespace.RadWindowModal.prototype.RestoreInputElementsState = function()
    {
        if (this.Window.IsIE)
        {
            this.DisabledDrodpowns = false;
            for (var i = 0; i < this.InputElementsState.length; i++)
            {
                var _o = this.InputElementsState[i];
                if (_o.isEnabled)
                {
                    _o.inputElement.removeAttribute("disabled");
                }
            }
        }
    }
    RadWindowNamespace.RadWindowModal.prototype.DisableInputElements = function()
    {
        if (this.Window.IsIE && !this.DisabledDrodpowns)
        {
            this.InputElementsState = [];
            var lists = document.getElementsByTagName("SELECT");
            for (var i = 0; i < lists.length; i++)
            {
                this.InputElementsState[i] = {
                    inputElement: lists[i],
                    isEnabled: !(lists[i].getAttribute("disabled"))
                };
     
                lists[i].setAttribute("disabled", "disabled");
            }
            this.DisabledDrodpowns = true;
        }
    }

    If this doesn't help or you are using a recent version of the control (RadWindow for ASP.NET AJAX), please provide the exact version of the control that you are using along with a code of a simple page where the problem could be reproduced so we could investigate further.

    Kind regards,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Dan Appleyard
    Dan Appleyard avatar
    6 posts
    Member since:
    Jan 2010

    Posted 29 Jun 2010 Link to this post

    We are using ASP.NET AJAX Controls.  The specific version is 2009.3.1314.35.
    The issue lies in viewing the page in IE 6.  
    Here is the code that demonstrates the issue - 

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits=".WebForm1" %> 
     
    <%@ Register Assembly="Telerik.Web.UI" 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></title
    </head> 
    <body> 
        <form id="form1" runat="server"
        <div> 
            <telerik:RadScriptManager ID="manager1" runat="server"
            </telerik:RadScriptManager> 
     
            <asp:DropDownList ID="ddl1" runat="server"
                <asp:ListItem Value="1">Item 1</asp:ListItem> 
                <asp:ListItem Value="2">Item 2</asp:ListItem> 
                <asp:ListItem Value="3">Item 2</asp:ListItem> 
            </asp:DropDownList> 
            <asp:Button ID="btn1" runat="server" OnClientClick="ShowModal(); return false;" Text="click" /> 
        </div> 
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" /> 
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"
     
            <script type="text/javascript"
                function ShowModal() { 
                    var wnd = radopen('<%=ResolveUrl("~/register.aspx") %>', null); 
                    wnd.set_modal(true); 
                    wnd.center(); 
                    wnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Resize); 
                    wnd.show(); 
                } 
            </script> 
     
        </telerik:RadScriptBlock> 
        </form> 
    </body> 
    </html> 

  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 30 Jun 2010 Link to this post

    Hi Dan,

    The problem here is with the logic. With your code you do the following:
    1. open the RadWindow control
    2. set its modal property to true. In this case we are hiding the dropdowns in IE6.
    3. set  the behaviors of the control
    4. center the window (I assume you do this to redraw the window after setting its behaviors).
    5. You call the show() method again. Because you are calling show() for a window that is modal, the code that hides the dropdowns is run again - that is the reason for them not being visible after the window is closed.
    To avoid the problem, I suggest not to call show() again, but to call the center() method last.
    I hope this helps.

    Regards,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Dan Appleyard
    Dan Appleyard avatar
    6 posts
    Member since:
    Jan 2010

    Posted 30 Jun 2010 Link to this post

    This solves the problem with the dropdown staying hidden after the modal is closed, but the dropdown is hidden upon initial launch of the modal.  Why is that?  Is there a way to stop that?

    Thanks!
  6. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 01 Jul 2010 Link to this post

    Hello Dan,

    This is needed because prior to IE7, dropdowns and list items were heavyweight objects that were rendered above all DHTML elements on the page, including the modal background of RadWindow. This made possible for users to still use the dropdowns on the parent page even if a modal RadWindow was shown.
    To avoid that we explicitly disable the dropdowns if the browser is IE7+ and hide them completely if it is IE6.

    To answer your question, yes - there is a way to disable this functionality with a custom code, but I do not recommend it because your users will be able to interact with the INPUT elements even if you have a modal dialog shown on the page.

    All the best,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Dan Appleyard
    Dan Appleyard avatar
    6 posts
    Member since:
    Jan 2010

    Posted 07 Jul 2010 Link to this post

    That fixes the initial issue, but now it introduces an issue with not being able to close said modal.  Also if there is a rad menu on the parent page, it's z-index is altered and the menu items appear above the modal.  Changing wnd.center() to wnd.show() solves that, but once again we are back to square 1 with the initial issue.
  8. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 12 Jul 2010 Link to this post

    Hello Dan,

    In such case, please open a support ticket and send a sample project that reproduces your exact setup and the problem itself. This way, we will get a better view over your scenario and will do our best to provide you with a solution. As for the problem with the menu, make sure that the z-index is properly set - more information on the subject is available here.

    Greetings,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top