System.Gadget.Flyout.document Property

Gets an object that represents the Document Object Model (DOM) of the gadget Flyout HTML file.

This property is read-only.

Syntax

propVal = System.Gadget.Flyout.document()

  

Parameters

  • oDocument [out]
    Retrieves the gadget DOM.

Remarks

Equivalent to the JavaScript object.

Facilitates interaction between the main gadget window and a gadget Flyout by providing the ability to modify the other window's DOM and trigger events.

Examples

The following example demonstrates how to use the document object to update the gadget DOM from a gadget Flyout.

The gadget HTML file.

<body onload="Init();">
    <g:background id="imgBackground" src="url(images/background.png)">
    <div id="gadgetContent">
        <span id="strTimeDisplay"></span><br />
        <a href="javascript:void(0);" onclick="showFlyout();">Show Flyout</a><br />
        <span id="sFlyoutFeedback"></span>
    </div>
    </g:background>
</body>

The gadget Flyout HTML file.

<body>
<g:background id="imgBackground" src="url(images/background.png)">
<div id="flyoutContent">
    <span id="strTimeDisplay"></span><br />
    <a href="javascript:void(0);" onclick="hideFlyout();">Hide Flyout</a><br />
    <input type="text" id="txtFeedback" onkeyup="showInGadget(this);" />
</div>
</g:background>
</body>

The gadget script file.

// --------------------------------------------------------------------
// Display the flyout associated with the "Flyout" gadget sample.
// --------------------------------------------------------------------
function showFlyout()
{
    System.Gadget.Flyout.show = true;
    oFlyoutDocument = System.Gadget.Flyout.document;
}

// --------------------------------------------------------------------
// Display the system time.
// --------------------------------------------------------------------
function DisplayTime()
{
    // Retrieve the local time.
    var sTimeInfo = System.Time.getLocalTime(System.Time.currentTimeZone);
    var dDateInfo = new Date(Date.parse(sTimeInfo));   
    var tHours = dDateInfo.getHours();
    var tMinutes = dDateInfo.getMinutes();
    tMinutes = ((tMinutes < 10) ? ":0" : ":") + tMinutes
    var tSeconds = dDateInfo.getSeconds();
    tSeconds = ((tSeconds < 10) ? ":0" : ":") + tSeconds;
    strTimeDisplay.innerHTML = tHours + tMinutes + tSeconds;
    if (oFlyoutDocument)
    {
        oFlyoutDocument.getElementById("strTimeDisplay").innerText = strTimeDisplay.innerHTML;
    }
}

Requirements

Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
IDL Sidebar.idl
DLL Sidebar.Exe version 1.00 or later

See Also

System.Gadget.Flyout

 

 

Send comments about this topic to Microsoft

Build date: 2/24/2010

Build type: SDK