1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV01021624"><META NAME="lcid" CONTENT="1033"><title>viewContext Attribute</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><p id="ExpandAllLine" class="ExpFav"><a href="#" onclick="ExpandAll()" onkeypress="ExpandAll()" class="DropDown"><img id="picHeader" border="0" src="expandtri.gif" alt="Show All"><span id="ExpandAll">Show All</span></a></p><h1>viewContext Attribute</h1><div class="ofvbanav"><span class="ofvbanavreuse" id="seealso" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="parentelements" onclick="toggleList()" onkeypress="toggleList()"></span></div><p>Specifies a string that identifies an HTML element in the view.</p><h2>Type</h2><p><pre><code>xsd:string</code></pre></p><h2>Remarks</h2><p>The <b class="bterm">viewContext</b> attribute is an optional attribute of the <b class="bterm"><a href="xsfelmxmlToEdit.htm" id="HV01021519" lcid=" ">xmlToEdit</a></b> element.</p><p>The <b class="bterm">viewContext</b> attribute names an HTML element that has the <b class="bterm">xd:CtrlId</b> attribute. For example, <code>viewContext="myID"</code> in the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition (.xsf) file</a> corresponds to <code>xd:CtrlId="myID"</code> in the XSLT/HTML code for the view.<p><b>Note</b> If the <b class="bterm">xd:CtrlId</b> attribute is not used in the XSLT/HTML code for the view, then the <b class="bterm">viewContext</b> attribute is ignored.</p></p><p>The <b class="bterm">viewContext</b> attribute can be used to disambiguate controls when two instances of the same control have the same XML context (so that the XML context is identical).
An example is a table of contents with chapter titles, and below, the same chapters repeated with full content. Two <b class="bterm"><a href="xsfelmeditWith.htm" id="HV01021472" lcid=" ">editWith</a></b> elements for item="chapter" but different view contexts can specify distinct behavior.</p><h2><a id="#example" name="#example">Example</a></h2><p>The following is an example of the <b class="bterm">viewContext</b> attribute as it is used in the <b class="bterm">xmlToEdit</b> element:</p><pre><code><xsf:editing>
<xsf:xmlToEdit name="CD_10"
item="/CustomUISample/CDCollection/CD"
container="/CustomUISample">
<b class="bterm">viewContext</b>="cdID"
<xsf:editWith caption="CD"
xd:autogeneration="template"
component="xCollection">
<xsf:fragmentToInsert>
<xsf:chooseFragment parent="CDCollection">
<CD>
<Title></Title>
<Artist></Artist>
<Tracks>
<Track></Track>
<Track></Track>
</Tracks>
</CD>
</xsf:chooseFragment>
</xsf:fragmentToInsert>
</xsf:editWith>
</xsf:xmlToEdit>
</xsf:editing></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/xsfatrviewContext_l.htm"></iframe></span><center><a href="XMLSchemaCopyright_HV01147162.htm">©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&CTT=11&Origin=HV011232471033"
target="_new">http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp</a></center></body></html>
|