Windows Sidebar gadget - cannont access a div in Flyout DOM
- by cyrix86
In the main gadget html, there is a div with an onclick that calls this method in the Gadget script file:
ShowFlyout = function()
{
System.Gadget.Flyout.show = true;
var flyoutDoc = System.Gadget.Flyout.document;
var mainFlyoutDiv = flyoutDoc.getElementById('divFlyout');
mainFlyoutDiv.innerHTML = "hello";
}
Here is the Flyout html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>This is a flyout</title>
<link href="Css\FlyoutStyle.css" type="text/css" rel="Stylesheet" />
</head>
<body>
<div id="divFlyout" >
</div>
</body>
</html>
The problem is that mainFlyoutDiv is always null. When peering into the System.Gadget.Flyout.document object through the debugger, the body parameter is null - I don't think that's right. The System.Gadget.Flyout.file value is being set elsewhere when the gadget first loads.
What am I doing wrong?
Also, does the System.Gadget.Flyout.show property have to be true before the System.Gadget.Flyout.document property can be accessed? My ultimate goal is to open a flyout and dynamically populate it's html