File: xdobjDocContextChangeEventObject_HV01104103.htm

package info (click to toggle)
office2003-schemas 1.0%2Bds-1
  • links: PTS, VCS
  • area: non-free
  • in suites: bookworm, forky, sid, trixie
  • size: 42,304 kB
  • sloc: javascript: 2,429; makefile: 29
file content (19 lines) | stat: -rw-r--r-- 4,996 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV01104103"><META NAME="lcid" CONTENT="1033"><title>DocContextChangeEvent Object</title><link rel="stylesheet" type="text/css" href="office10.css"><script type="text/javascript" language="Javascript" src="ExpCollapse.js"></script><script type="text/javascript" language="JavaScript" src="inline.js"></script></head><body><h1>DocContextChangeEvent Object</h1><div class="ofvbanav"><span class="ofvbanavreuse" id="seealso" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="properties" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="methods" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="events" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="specifics" onclick="toggleList()" onkeypress="toggleList()"></span></div><p>An event object that is used during a Microsoft Office InfoPath 2003 context change event. The <b class="bterm">DocContextChangeEvent</b> object provides a number of properties that can be used within a context change to programmatically interact with the data in a form's underlying XML document, to provide contextual feedback to the user, or to  perform actions for the user.</p><h2>Remarks</h2><p>The <b class="bterm">DocContextChangeEvent</b> object is passed as a parameter to the <a href="xdevtOnContextChange_HV01104102.htm" id="HV01104102" lcid=" "><b class="bterm">OnContextChange</b></a> event.</p><p>The <b class="bterm">DocContextChangeEvent</b> object is used to get information about the XML Document Object Model (DOM) node that is the current context of the form's underlying XML document. In addition, it provides information about the type of context change and whether the change happened in response to an undo or redo operation performed by the user.</p><p>As described in the <a href="xdevtOnContextChange_HV01104102.htm" id="HV01104102" lcid=" "><b class="bterm">OnContextChange</b></a> event topic, the <a href="xdproType_5_HV01104105.htm" id="HV01104105" lcid=" "><b class="bterm">Type</b></a> property returns only the value "ContextNode" for context changes in Microsoft InfoPath 2003 Service Pack 1. Nevertheless, if code in an event handler performs actions that depend on current functionality, that code should still be designed to check the value of the <b class="bterm">Type</b> property, because future versions of InfoPath may use different values for different context changes.</p><p><p><b>Note</b>  This object model member is not supported when the <b class="ui">Disable Service Pack features</b> option on the <b class="ui">Advanced</b> tab of the <b class="ui">Options</b> dialog box in InfoPath is selected or when Microsoft Office 2003 Service Pack 1 or later is not installed. Any form that implements this object model member in its code will generate an error message if it is opened in InfoPath when service pack features are disabled or unavailable.</p></p><h2>Using the DocContextChangeEvent object</h2><p>When the <a href="xdproIsUndoRedo_1_HV01104119.htm" id="HV01104119" lcid=" "><b class="bterm">IsUndoRedo</b></a> property of the <b class="bterm">DocContextChangeEvent</b> object is <b class="bterm">True</b>, the context change was caused by an undo or redo operation rather than an explicit user context change. Operations performed in the <b class="bterm">OnContextChange</b> event handler that modify the XML DOM should be avoided in response to undo or redo actions, because they may interfere with the user's intention to revert data to a previous state.</p><h2><a id="#example" name="#example">Example</a></h2><p>In the following example, a node named lastChanged is updated in response to context changes:</p><pre><code>function XDocument::OnContextChange(eventObj) 
{
    if ( eventObj.Type == "ContextNode" &amp;&amp; !eventObj.IsUndoRedo )
    {
        var oContextNode = eventObj.Context;
        var oLastChangedNode = 
            XDocument.DOM.selectSingleNode("my:lastChanged");
       
        oLastChangedNode.text = oContextNode.nodeName;
    }
}</code></pre><script type="text/javascript" language="JScript" src="ofvbanl.js"></script><span id="ofVBAISpan" class="ofvbaispan"><iframe id="ofVBAIFrame" frameborder="0" marginheight="0" marginwidth="4" scrolling="auto" width="100%" src="../links/xdobjDocContextChangeEventObject_HV01104103_l.htm"></iframe></span><center><a href="XMLSchemaCopyright_HV01147162.htm">&copy;2003-2004 Microsoft Corporation. All rights reserved.</a>  

Permission to copy, display and distribute this document is available at: <a 

href="http://r.office.microsoft.com/r/rlidAWSContentRedir?AssetID=XT010988631033&amp;CTT=11&amp;Origin=HV011232471033" 

target="_new">http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp</a></center></body></html>