1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
  
     | 
    
      <html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV07313095"><META NAME="lcid" CONTENT="1033"><title>Custom task panes in the User Interface developer sample form</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>Custom task panes in the User Interface developer sample form</h1><div class="ofvbanav"><span class="ofvbanavreuse" id="seealso" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="specifics" onclick="toggleList()" onkeypress="toggleList()"></span></div><p>The User Interface developer sample form implements a <a href="#" class="glossary" onclick="AppendPopup(this,'xdcustomtaskpane')" onkeypress="AppendPopup(this,'xdcustomtaskpane')">custom task pane</a> that is used to switch <a href="#" class="glossary" onclick="AppendPopup(this,'xdview')" onkeypress="AppendPopup(this,'xdview')">views</a> and perform other general-purpose operations, such as sorting the list of CDs. Custom task panes are  <a href="#" class="glossary" onclick="AppendPopup(this,'ofhtml')" onkeypress="AppendPopup(this,'ofhtml')">.html</a> files that are displayed in the Microsoft Office InfoPath 2003 task pane as a user fills out a form.
			There can be only one custom task pane associated with a form.</p><p>To create a custom task pane, you must first create an .html file by using an HTML editor such as Microsoft FrontPage. You associate this .html file with a form by using the <b class="ui">Advanced</b> tab in the <b class="ui">Form Options</b> dialog box that is available on the <b class="ui">Tools</b> menu in <a href="#" class="glossary" onclick="AppendPopup(this,'xddesignmode')" onkeypress="AppendPopup(this,'xddesignmode')">design mode</a>. The <b class="ui">Advanced</b> tab allows you to add the .html file and any other supporting files, such as a cascading style sheet (.css file), using the Resource Manager. (The Resource Manager can also be accessed   by clicking <b class="ui">Resource Manager</b> on the <b class="ui">Tools</b> menu in design mode.) After the .html file has been added as a resource, you can select the <b class="ui">Enable custom task pane</b>
			check box and set the name and location of your custom task pane.</p><p><b>Note</b>  You must add the .html file to the form using the Resource Manager before you can make the file a custom task pane.</p><p>When you add a custom task pane to a form, InfoPath creates entries in the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition (.xsf) file</a> using the <b class="bterm"><a href="xsfelmtaskpane.htm" id="HV01021505" lcid=" ">taskpane</a></b> element. The <b class="bterm"><a href="xsfatrcaption_2.htm" id="HV01021529" lcid=" ">caption</a></b> attribute of the <b class="bterm">taskpane</b> element is used to store the name of the custom task pane, while the <b class="bterm"><a href="xsfatrhref_2.htm" id="HV01021554" lcid=" ">href</a></b> attribute is used to store the .html file name. The following is a section from the .xsf file of the User Interface developer sample form that contains the <b class="bterm">taskpane</b> element:</p><p><pre><code><xsf:taskpane
   caption="Custom Task Pane"
   href="taskpane.htm">
</xsf:taskpane></code></pre></p><p>In addition to using standard HTML markup, you can also use scripting code within the task pane that calls the InfoPath object model. In the User Interface developer sample form, the <b class="bterm"><a href="xdproExtension.htm" id="HV01021284" lcid=" ">Extension</a></b> property of the <b class="bterm"><a href="xdobjXDocument.htm" id="HV01021254" lcid=" ">XDocument</a></b> object is used to gain access to the business logic functions contained in the form's primary script file.</p><p>The following is a section from the .html file used as the custom task pane in the User Interface developer sample form. The call to the InfoPath object model's <b class="bterm">Extension</b> property is used in the <b class="bterm">onClick</b> event for the <b class="ui">Sort CDs</b> hyperlink. When the user clicks this link, the Sort function within the form's primary script file is called. The Sort function then takes the source XML document for the form and sorts the collection of CDs alphabetically according to artist and track.</p><p><pre><code><div class="action">
   <a href="" 
      onClick="gobjXDocument.Extension.Sort();return false;">
      Sort CDs by artist/title</a>
</div></code></pre></p><p><b>Note</b>  To view the business logic functions for the User Interface developer sample form, you can open <a href="#" class="glossary" onclick="AppendPopup(this,'xdmicrosoftscripteditormse')" onkeypress="AppendPopup(this,'xdmicrosoftscripteditormse')">Microsoft Script Editor (MSE)</a> in InfoPath design mode by clicking the <b class="ui">Tools</b> menu, pointing to <b class="ui">Script</b>, and clicking <b class="ui">Microsoft Script Editor</b>, or by pressing ALT+SHIFT+F11.</p><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/inconCustomTaskpanesInUIForm_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> 
     |