Hi,
I bumped into a rather obscure problem when using RadWindow.
The problematic situation rises under the following circumstances:
An input field with selected content has style.display="none" on the same page as the RadWindow is shown. Then try to move or resize the window. An Unknown Runtime Error occurs in the Telerik script at the point where document.selection.empty() is called.
From DOM perspective I can imagine that emptying the selection on a non-visible element is problematic, but I think the Telerik script should anticipate such a situation and act accordingly instead of letting an error occur.
I can imagine it might come across as a weird situation having a hidden input field with selected content (on the same page as a RadWindow) so let me explain the situation I encountered the problem:
I have a edit form with a tab strip combined with a multi page. On the first tab the first input is selected and given focus so that the user can start altering the data easily. On the second tab there is a button which causes a RadWindow to appear as a modal dialogue where the edited user can be linked to user groups. When I let the selected content on the first tab to remain selected when I switch to the second tab, click the button which causes the RadWindow to appear and then try to move or resize the RadWindow I get the Unknow Runtime Error on the line where document.selection.empty() is called.
While searching for the one exact cause of my problem I have created a situation as simple as possible which demonstrates the problem. For your convenience I will place it here:
There is nothing custom in the code behind file.
I hope this problem can be fixed. (I expect a check whether the selected content is visible should be the way to go.)
Regards,
Mink
I bumped into a rather obscure problem when using RadWindow.
The problematic situation rises under the following circumstances:
An input field with selected content has style.display="none" on the same page as the RadWindow is shown. Then try to move or resize the window. An Unknown Runtime Error occurs in the Telerik script at the point where document.selection.empty() is called.
From DOM perspective I can imagine that emptying the selection on a non-visible element is problematic, but I think the Telerik script should anticipate such a situation and act accordingly instead of letting an error occur.
I can imagine it might come across as a weird situation having a hidden input field with selected content (on the same page as a RadWindow) so let me explain the situation I encountered the problem:
I have a edit form with a tab strip combined with a multi page. On the first tab the first input is selected and given focus so that the user can start altering the data easily. On the second tab there is a button which causes a RadWindow to appear as a modal dialogue where the edited user can be linked to user groups. When I let the selected content on the first tab to remain selected when I switch to the second tab, click the button which causes the RadWindow to appear and then try to move or resize the RadWindow I get the Unknow Runtime Error on the line where document.selection.empty() is called.
While searching for the one exact cause of my problem I have created a situation as simple as possible which demonstrates the problem. For your convenience I will place it here:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MoveRadWindowTest.aspx.cs" Inherits="CMS.Views.Tests.MoveRadWindowTest" %> |
<%@ 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"> |
<asp:ScriptManager ID="ScriptManager1" runat="server" /> |
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="OpenRadWindow();return false;" /> |
<div id="HideMe"> |
<asp:TextBox ID="TextBox1" runat="server" /> |
</div> |
<telerik:RadWindow ID="RadWindow1" runat="server" Modal="true" NavigateUrl="http://www.telerik.com" /> |
</form> |
<script type="text/javascript"> |
function OpenRadWindow() { |
$get('HideMe').style.display = "none"; |
$find("<%=RadWindow1.ClientID%>").show(); |
} |
</script> |
</body> |
</html> |
There is nothing custom in the code behind file.
I hope this problem can be fixed. (I expect a check whether the selected content is visible should be the way to go.)
Regards,
Mink