This is a migrated thread and some comments may be shown as answers.

RadComboBox and RadTextBox disabled after closing the window

4 Answers 105 Views
Window
This is a migrated thread and some comments may be shown as answers.
dmw
Top achievements
Rank 1
dmw asked on 18 Jan 2011, 10:53 AM
Hello,

Our web app has a couple of RadComboBoxes and a RadTextBox on the main page. If I open a RadWindow to certain pages, and then close it using the 'X' in the top right corner, these other controls are unable to receive focus. They appear enabled, but clicking in them does not produce a text caret, and I cannot type into them.

The type of page which causes this behaviour is 1) hosted on another server, and 2) contains a text box of some kind, which has focus when the window is closed. For example, I set it up to load the Google homepage.

I found the following topic which describes a similar problem, but it is related to RadEditor, which this app does not use.
http://www.telerik.com/community/forums/aspnet-ajax/editor/editor-stealing-cursor-from-textboxes-in-ie.aspx

Telerik version is 2009.3.1314.35 and I am using Internet Explorer 8.

Thanks for any help.

4 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 20 Jan 2011, 04:24 PM
Hi dmw,

 We are not aware of such a problem with RadWindow and the one discussed in the thread you have linked is a different setup where the problem comes from the RadEditor control.

That is why we will really need to examine either sample reproduction code or at least a live url where we can see what is actually going on. Please, provide such along with detailed reproduction step sand explanations and we will do our best to help.

Meanwhile, you can test with the latest version of RadControls since yours is very old and it is possible that fixing some other issue has resolved this problem , too.

All the best,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
dmw
Top achievements
Rank 1
answered on 21 Jan 2011, 11:15 AM
Hi, thanks for the reply.

I have attached the code from a simple web app I made to reproduce the problem. It contains a RadComboBox and a RadTextBox, as well as a link to open RadWindow to Google.
  1. Click on each control to verify that they receive the text caret.
  2. Click the link to open Google in the RadWindow. Google search box should receive focus automatically, if not then focus it.
  3. Click the 'X' to close the RadWindow.
  4. Click on each control again and note that they do not receive the caret and cannot be typed in to

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadWindowTest1._Default" %>
<%@ 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">
<head runat="server">
    <title>RadWindowTest1</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            function OpenRadWindow() {
                $find('<%= RadWindowManager1.ClientID %>').Open('http://www.google.com/ncr');
            }
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <telerik:RadComboBox ID="RadComboBox1" Runat="server" AllowCustomText="True">
        <Items>
            <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1"
                Value="RadComboBoxItem1" />
            <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2"
                Value="RadComboBoxItem2" />
            <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3"
                Value="RadComboBoxItem3" />
        </Items>
    </telerik:RadComboBox>
    <telerik:RadTextBox ID="RadTextBox1" Runat="server" EmptyMessage="Empty"
        Width="125px" Text="RadTextBox">
    </telerik:RadTextBox>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
        DestroyOnClose="True" KeepInScreenBounds="True" Modal="True" Behavior="Default"
        InitialBehavior="None" Height="400px" Width="600px">
    </telerik:RadWindowManager>
    <a href="javascript:OpenRadWindow();">Open Window</a>
    </form>
</body>
</html>
0
Svetlina Anati
Telerik team
answered on 26 Jan 2011, 11:57 AM
Hello dmw,

 Thank you for the provided demo, I was able to reproduce the problem.


It turned out to be related to browser specific behavior when focusing another page and removing the whole IFRAME from the DOM. When you have set DestroyOnClose to true, after you close the RadWindow, not only its client object is disposed, but the HTML is removed from the DOM tree and IE8 does not return the focus.

What I can suggest is the following:

1) Remove DestroyOnClose="true" if your scenario allows this.
2) Keep the setting but trick the browser to return the focus - e.g as I did in the code below:

<%@ Page Language="C#" %>
  
<%@ 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">
<head id="Head1" runat="server">
    <title>RadWindowTest1</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            function OpenRadWindow()
            {
                $find('<%= RadWindowManager1.ClientID %>').Open('http://www.google.com/ncr');
            }
            function OnClientClose()
            {
                if ($telerik.isIE8)
                {
                    $get("test").style.display = "";
                    $get("test1").focus();
                    $get("test").style.display = "none";
                }
  
            }
        </script>
    </telerik:RadScriptBlock>
    <div style="display: none" id="test">
        <input id="test1" />
    </div>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <telerik:RadComboBox ID="RadComboBox1" runat="server" AllowCustomText="True">
        <Items>
            <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" Value="RadComboBoxItem1" />
            <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" Value="RadComboBoxItem2" />
            <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3" Value="RadComboBoxItem3" />
        </Items>
    </telerik:RadComboBox>
    <telerik:RadTextBox ID="RadTextBox1" runat="server" EmptyMessage="Empty" Width="125px"
        Text="RadTextBox">
    </telerik:RadTextBox>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" DestroyOnClose="True"
        KeepInScreenBounds="True" Modal="True" Behavior="Default" InitialBehavior="None"
        Height="400px" Width="600px" OnClientClose="OnClientClose">
    </telerik:RadWindowManager>
    <a href="javascript:OpenRadWindow();">Open Window</a>
    </form>
</body>
</html>

Regards,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
dmw
Top achievements
Rank 1
answered on 31 Jan 2011, 11:55 AM
Thank you for your response Svetlina, I have added your javascript workaround into my project and it resolves the problem.
Tags
Window
Asked by
dmw
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
dmw
Top achievements
Rank 1
Share this question
or