Hi,
I've encountered a problem after upgrading from RadControls for ASP.Net AJAX 2008 Q3 1314 to 2009 Q2 826.
I'm using rad windows and when the user closes one they get a warning in a rad confirm box, if they click ok the window should close if they click cancel it stays.
This all worked great in the 2008 Q3 release but in the newer 2009 Q2 release when you click ok on the rad confirm box the window doesn't close.
Here are the scripts I am using to open the windows and to handle the showing on the confirm box:
and the html:
any ideas?
Thanks,
Ian
I've encountered a problem after upgrading from RadControls for ASP.Net AJAX 2008 Q3 1314 to 2009 Q2 826.
I'm using rad windows and when the user closes one they get a warning in a rad confirm box, if they click ok the window should close if they click cancel it stays.
This all worked great in the 2008 Q3 release but in the newer 2009 Q2 release when you click ok on the rad confirm box the window doesn't close.
Here are the scripts I am using to open the windows and to handle the showing on the confirm box:
function OpenAWindow(url, title) { |
var win = radopen(url, null); |
win.set_title(title); |
win.set_status(""); |
win.add_pageLoad(function() { win.set_status(""); }); |
alert(win.offsetLeft); |
} |
function OnBeforeClose(sender, arg) { |
function callbackFunction(arg) { |
if (arg) { |
sender.remove_beforeClose(OnBeforeClose); |
sender.close(); |
if (!AnyWindowsVisible()) { |
document.getElementById('<%= btnClose.ClientID %>').click(); |
} |
} |
} |
arg.set_cancel(true); |
var messageBody = document.getElementById('<%= hdnWarningMessage.ClientID %>').value; |
var messageTitle = document.getElementById('<%= hdnWarningTitle.ClientID %>').value; |
radconfirm(messageBody, callbackFunction, 300, 100, null, messageTitle); |
} |
function AnyWindowsVisible() { |
var result = false; |
var manager = GetRadWindowManager(); |
for (var i = 0; i < manager.get_windows().length; i++) { |
if (manager.get_windows()[i].isVisible()) { |
result = true; |
break; |
} |
} |
return result; |
} |
function OnClientShow(sender) { |
sender.add_beforeClose(OnBeforeClose); |
} |
<asp:UpdatePanel ID="pnlScript" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional"> |
<ContentTemplate> |
<asp:Literal ID="litScriptAnchor" runat="server" /> |
<asp:HiddenField ID="hdnWarningMessage" runat="server" /> |
<asp:HiddenField ID="hdnWarningTitle" runat="server" /> |
</ContentTemplate> |
</asp:UpdatePanel> |
<div class="TelerikWindowRestrictedZone_Container"> |
<div class="TelerikWindowRestrictedZone_Header"> |
</div> |
<div id="WindowContainer" class="TelerikWindowRestrictedZone_Body"> |
</div> |
</div> |
<asp:UpdatePanel ID="pnlWindowCommands" runat="server"> |
<ContentTemplate> |
<asp:Button ID="btnClose" runat="server" Text="close" OnClick="btnClose_Click" Style="display: none;" /> |
</ContentTemplate> |
</asp:UpdatePanel> |
<asp:UpdatePanel ID="pnlWindows" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional"> |
<ContentTemplate> |
<telerik:RadWindowManager ID="ucRadWindowManager" RestrictionZoneID="WindowContainer" OnClientDragEnd="FixFocus" OnClientResize="FixFocus" OnClientCommand="FixFocus" OnClientShow="OnClientShow" PreserveClientState="true" runat="server" Skin="Telerik"> |
</telerik:RadWindowManager> |
</ContentTemplate> |
</asp:UpdatePanel> |
any ideas?
Thanks,
Ian