Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ian on Sep 09, 2009 08:40
open dhtmlx forum
Attempting to close a window gives - Access is denied

-----------------------------------------------------------------------------------------------------------------------------------------------------
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
Timestamp: Wed, 9 Sep 2009 14:46:42 UTC


Message: Access is denied.

Line: 44
Char: 28205
Code: 0
URI: http://localhost:8084/DHTMLX_Test/codebase/dhtmlxwindows.js
-----------------------------------------------------------------------------------------------------------------------------------------------------

Hi guys,

I been placed on a new project that uses the dhtmlx pro software and I'm having to learn the APIs in short order. I have come across a problem that, as far as I can tell, shouldn't be happening.

Having created a layout containing a viewport on which I am displaying a single window. This window closes normally when displayed with any other dhtmlx components, but when a URL is attached I get the above javascript error...

I had a look at the sample code you provided for similar problem that someone else encountered... That code does work correctly. However, after examination I found that the dhtmlxcommon.js and dhtmlxwindows.js files were different. (To what extent I'm not sure) The files I'm using are from the dhtmlxSuite_v25_pro_90904.zip archive which I believe is the latest version.

I've included a sample of the code I've been running below... Just uncomment the line to attach the URL to see that the window doesn't close and produces the above mentioned error.

Any assistance will be greatly appreciated. As I'm finding this particular issue very frustrating. By the way the browser I'm using is IE8

Thanks

-----------------------------------------------------------------------------------------------------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>DHTMLX Demo</title>
<link rel="stylesheet" type="text/css" href="codebase/dhtmlxlayout.css">
<link rel="stylesheet" type="text/css" href="codebase/skins/dhtmlxlayout_dhx_blue.css">
<link rel="stylesheet" type="text/css" href="codebase/dhtmlxwindows.css">
<link rel="stylesheet" type="text/css" href="codebase/skins/dhtmlxwindows_dhx_blue.css">
<link rel="stylesheet" type="text/css" href="codebase/skins/dhtmlxmenu_dhx_blue.css">
<script src="codebase/dhtmlxcommon.js"></script>
<script src="codebase/dhtmlxlayout.js"></script>
<script src="codebase/dhtmlxwindows.js"></script>
<script src="codebase/dhtmlxmenu.js"></script>
<script src="codebase/ext/dhtmlxmenu_ext.js"></script>
<script src="codebase/dhtmlxcontainer.js"></script>
<style>
html, body
{
width: 100%;
height: 100%;
overflow: hidden;
}
</style>
<script>
var dhxLayout, dhxWins, menu, statusBar;
function doOnLoad()
{
dhxLayout = new dhtmlXLayoutObject(document.body, "1C", "dhx_blue");
dhxLayout.cells("a").hideHeader();
dhxLayout.cells("a").attachObject("winVP");

menu = dhxLayout.attachMenu();
menu.setIconsPath("common/imgs/");
menu.loadXML("common/dhxmenu.xml?etc=" + new Date().getTime(), function() {});
menu.attachEvent("onClick", menuClick);

statusBar = dhxLayout.attachStatusBar();
statusBar.setText("DHTMLX Demo");

dhxWins = new dhtmlXWindows();
dhxWins.enableAutoViewport(false);
dhxWins.attachViewportTo("winVP");
dhxWins.setImagePath("codebase/imgs/dhxwins_dhx_blue");

var w1 = dhxWins.createWindow("w1", 0, 0, 1000, 550);
w1.setText("Welcome to Google");
w1.keepInViewport(true);
w1.center();
// w1.attachURL("http://www.google.co.uk");
}

function menuClick(id)
{
alert("<b>onClick</b> Item " + menu.getItemText(id) + " (id:" + id + ") was clicked<br>");
return true;
}
</script>
</head>
<body onload="doOnLoad();" style="width:100%; height:100%; margin:0px; padding:0px; overflow:hidden;">
<div id="winVP" style="position: relative; width:100%; height:100%; border: #cecece 1px solid;"></div>
</body>
</html>
-----------------------------------------------------------------------------------------------------------------------------------------------------
Answer posted by Support on Sep 11, 2009 05:51
Hello,

Please try the attached demo (based on your code).
Updated file: dhtmlxwindows.js
Attachments (1)
demo.zip119.01 Kb