<?xml version="1.0" encoding="UTF-8"?>
<?xfa generator="AdobeLiveCycleDesigner_V11.0.0.20130303.1.892433" APIVersion="3.6.13061.0"?>
<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" >
<template xmlns="http://www.xfa.org/schema/xfa-template/3.3/">
   <?formServer defaultPDFRenderFormat acrobat10.0dynamic?>
   <subform name="form1" layout="tb" locale="en_US" restoreState="auto">
      <pageSet>
         <pageArea name="Page1" id="Page1">
            <contentArea x="0.25in" y="0.25in" w="576pt" h="756pt"/>
            <medium stock="default" short="612pt" long="792pt"/>
            <?templateDesigner expand 1?></pageArea>
         <?templateDesigner expand 1?></pageSet>
      <subform w="203.2mm" layout="tb" name="ParentSubform">
         <subform w="139.7mm" h="95.25mm" name="sampleForm">
            <field name="TextField1" y="44.45mm" x="34.925mm" w="90.575mm" h="9mm">
               <ui>
                  <textEdit>
                     <border>
                        <edge stroke="lowered"/>
                     </border>
                     <margin/>
                  </textEdit>
               </ui>
               <font typeface="Myriad Pro"/>
               <margin topInset="1mm" bottomInset="1mm" leftInset="1mm" rightInset="1mm"/>
               <para vAlign="middle"/>
               <caption reserve="48.4842mm">
                  <para vAlign="middle"/>
                  <value>
                     <text>sampleTemplateField</text>
                  </value>
               </caption>
            </field>
            <occur max="10"/>
            <?templateDesigner expand 1?></subform>
         <field h="6mm" name="AddSubformButton1" w="28.575mm">
            <ui>
               <button highlight="inverted"/>
            </ui>
            <font typeface="Arial"/>
            <caption>
               <value>
                  <text>Add Panel</text>
               </value>
               <para hAlign="center" vAlign="middle"/>
            </caption>
            <border hand="right">
               <edge stroke="raised"/>
               <fill>
                  <color value="212,208,200"/>
               </fill>
               <corner/>
            </border>
            <bind match="none"/>
            <event name="event__click" activity="click">
               <script contentType="application/x-javascript">//+ GENERATED - DO NOT EDIT (ID:E8CA3A83-D892-477F-BE8A-D10273DF7752 CRC:640672167)
//+ Type: Action
//+ Result1: AddInstance("$Node2")
//+ Node2: form1[0].ParentSubform[0].sampleForm[0]
//+ Node1: form1[0].ParentSubform[0].AddSubformButton1[0]
//+ Condition1: Button("$Node1","click")
//+ ActionName: AddSubformButton1.click
this.resolveNode('ParentSubform._sampleForm').addInstance(1);
if (xfa.host.version &lt; 8) {
   xfa.form.recalculate(1);
}
//-
/* This button will Add one instance of the repeating subform or table row.

   sSubformSOM: SOM expression of the repeating subform or table row.
   bCalc:       Flag - true if the new instance might be referenced by other calculations, otherwise false.
   message:    The error message displayed.  
   
   These variables must be assigned for this script to run correctly.
   Replace &lt;value&gt; with the correct value.
*/ 
var sSubformSOM = "&lt;value&gt;";  // Example: var sSubformSOM = "xfa.form.form1.Subform1";
var bCalc = true;          // Example: var bCalc = false;
var message = "You have reached the maximum number of items allowed.";


// DO NOT MODIFY THE CODE BEYOND THIS POINT - 11.0.0.20130303.1.892433.885247 - Subform_Instance_Controls_Add.xfo

// Build the SOM expression of the Instance Manager using the 'underscore' syntax.
var oSubform = xfa.resolveNode(sSubformSOM);      // Evaluate the SOM expression.
var sParentSOM = oSubform.parent.somExpression;      // Get the parent SOM expression.
var sManagerSOM = sParentSOM + "._" + oSubform.name; // Build the SOM expression of the Instance Manager.
var oManager = xfa.resolveNode(sManagerSOM);      // Evaluate the SOM expression.

var nMaxCount = oManager.occur.max;    // Get the maximum number of subform occurrences allowed.
var nSubCount = oManager.count;        // Get the current number of instances.

// Proceed if the maximum number of subform occurrences has not been reached.
if ((nMaxCount == "-1") || (nSubCount &lt; nMaxCount)) {
   
   // Invoke the Instance Manager.
   var oNewInstance = oManager.addInstance(1);

   // Fire the form calculations.
   if (bCalc == true) {
      
      // Execute all the form calculations.
      xfa.form.recalculate(1);
   }

} else {

   xfa.host.messageBox(message,"Add Item", 3);
}

// END OF DO NOT MODIFY
</script>
            </event>
            <assist>
               <toolTip>Add an item</toolTip>
            </assist>
         </field>
         <?templateDesigner expand 1?>
         <field h="6mm" name="AddSubformButton1" w="28.575mm">
            <ui>
               <button highlight="inverted"/>
            </ui>
            <font typeface="Arial"/>
            <caption>
               <value>
                  <text>Remove Panel</text>
               </value>
               <para hAlign="center" vAlign="middle"/>
            </caption>
            <border hand="right">
               <edge stroke="raised"/>
               <fill>
                  <color value="212,208,200"/>
               </fill>
               <corner/>
            </border>
            <bind match="none"/>
            <event name="event__click" activity="click">
               <script contentType="application/x-javascript">//+ GENERATED - DO NOT EDIT (ID:5F65CC5B-F502-4A90-8E06-C96610BF1004 CRC:2869508443)
//+ Type: Action
//+ Result1: RemoveInstance("$Node2","currentindex","")
//+ Node2: form1[0].ParentSubform[0].sampleForm[0]
//+ Node1: form1[0].ParentSubform[0].AddSubformButton1[1]
//+ Condition1: Button("$Node1","click")
//+ ActionName: AddSubformButton1[1].click
this.resolveNode('ParentSubform._sampleForm').removeInstance(this.parent.index);
if (xfa.host.version &lt; 8) {
   xfa.form.recalculate(1);
}
//-
/* This button will Add one instance of the repeating subform or table row.

   sSubformSOM: SOM expression of the repeating subform or table row.
   bCalc:       Flag - true if the new instance might be referenced by other calculations, otherwise false.
   message:    The error message displayed.  
   
   These variables must be assigned for this script to run correctly.
   Replace &lt;value&gt; with the correct value.
*/ 
var sSubformSOM = "&lt;value&gt;";  // Example: var sSubformSOM = "xfa.form.form1.Subform1";
var bCalc = true;          // Example: var bCalc = false;
var message = "You have reached the maximum number of items allowed.";


// DO NOT MODIFY THE CODE BEYOND THIS POINT - 11.0.0.20130303.1.892433.885247 - Subform_Instance_Controls_Add.xfo

// Build the SOM expression of the Instance Manager using the 'underscore' syntax.
var oSubform = xfa.resolveNode(sSubformSOM);      // Evaluate the SOM expression.
var sParentSOM = oSubform.parent.somExpression;      // Get the parent SOM expression.
var sManagerSOM = sParentSOM + "._" + oSubform.name; // Build the SOM expression of the Instance Manager.
var oManager = xfa.resolveNode(sManagerSOM);      // Evaluate the SOM expression.

var nMaxCount = oManager.occur.max;    // Get the maximum number of subform occurrences allowed.
var nSubCount = oManager.count;        // Get the current number of instances.

// Proceed if the maximum number of subform occurrences has not been reached.
if ((nMaxCount == "-1") || (nSubCount &lt; nMaxCount)) {
   
   // Invoke the Instance Manager.
   var oNewInstance = oManager.addInstance(1);

   // Fire the form calculations.
   if (bCalc == true) {
      
      // Execute all the form calculations.
      xfa.form.recalculate(1);
   }

} else {

   xfa.host.messageBox(message,"Add Item", 3);
}

// END OF DO NOT MODIFY
</script>
            </event>
            <assist>
               <toolTip>Add an item</toolTip>
            </assist>
         </field>
      </subform>
      <proto/>
      <desc>
         <text name="version">11.0.0.20130303.1.892433.887364</text>
      </desc>
      <?templateDesigner expand 1?></subform>
   <?templateDesigner DefaultPreviewDynamic 1?>
   <?templateDesigner DefaultRunAt client?>
   <?templateDesigner Grid show:1, snap:1, units:0, color:ff8080, origin:(0,0), interval:(125000,125000)?>
   <?templateDesigner FormTargetVersion 33?>
   <?templateDesigner DefaultCaptionFontSettings face:Myriad Pro;size:10;weight:normal;style:normal?>
   <?templateDesigner DefaultValueFontSettings face:Myriad Pro;size:10;weight:normal;style:normal?>
   <?templateDesigner DefaultLanguage JavaScript?>
   <?acrobat JavaScript strictScoping?>
   <?templateDesigner WidowOrphanControl 0?>
   <?templateDesigner SavePDFWithLog 0?>
   <?templateDesigner Zoom 98?>
   <?templateDesigner SaveTaggedPDF 0?>
   <?templateDesigner SavePDFWithEmbeddedFonts 0?>
   <?templateDesigner Rulers horizontal:1, vertical:1, guidelines:1, crosshairs:0?></template>
<config xmlns="http://www.xfa.org/schema/xci/3.0/">
   <agent name="designer">
      <!--  [0..n]  -->
      <destination>pdf</destination>
      <pdf>
         <!--  [0..n]  -->
         <fontInfo/>
      </pdf>
   </agent>
   <present>
      <!--  [0..n]  -->
      <pdf>
         <!--  [0..n]  -->
         <fontInfo>
            <embed>0</embed>
         </fontInfo>
         <tagged>0</tagged>
         <version>1.7</version>
         <adobeExtensionLevel>8</adobeExtensionLevel>
      </pdf>
      <xdp>
         <packets>*</packets>
      </xdp>
   </present>
</config>
<localeSet xmlns="http://www.xfa.org/schema/xfa-locale-set/2.7/">
   <locale name="en_US" desc="English (United States)">
      <calendarSymbols name="gregorian">
         <monthNames>
            <month>January</month>
            <month>February</month>
            <month>March</month>
            <month>April</month>
            <month>May</month>
            <month>June</month>
            <month>July</month>
            <month>August</month>
            <month>September</month>
            <month>October</month>
            <month>November</month>
            <month>December</month>
         </monthNames>
         <monthNames abbr="1">
            <month>Jan</month>
            <month>Feb</month>
            <month>Mar</month>
            <month>Apr</month>
            <month>May</month>
            <month>Jun</month>
            <month>Jul</month>
            <month>Aug</month>
            <month>Sep</month>
            <month>Oct</month>
            <month>Nov</month>
            <month>Dec</month>
         </monthNames>
         <dayNames>
            <day>Sunday</day>
            <day>Monday</day>
            <day>Tuesday</day>
            <day>Wednesday</day>
            <day>Thursday</day>
            <day>Friday</day>
            <day>Saturday</day>
         </dayNames>
         <dayNames abbr="1">
            <day>Sun</day>
            <day>Mon</day>
            <day>Tue</day>
            <day>Wed</day>
            <day>Thu</day>
            <day>Fri</day>
            <day>Sat</day>
         </dayNames>
         <meridiemNames>
            <meridiem>AM</meridiem>
            <meridiem>PM</meridiem>
         </meridiemNames>
         <eraNames>
            <era>BC</era>
            <era>AD</era>
         </eraNames>
      </calendarSymbols>
      <datePatterns>
         <datePattern name="full">EEEE, MMMM D, YYYY</datePattern>
         <datePattern name="long">MMMM D, YYYY</datePattern>
         <datePattern name="med">MMM D, YYYY</datePattern>
         <datePattern name="short">M/D/YY</datePattern>
      </datePatterns>
      <timePatterns>
         <timePattern name="full">h:MM:SS A Z</timePattern>
         <timePattern name="long">h:MM:SS A Z</timePattern>
         <timePattern name="med">h:MM:SS A</timePattern>
         <timePattern name="short">h:MM A</timePattern>
      </timePatterns>
      <dateTimeSymbols>GyMdkHmsSEDFwWahKzZ</dateTimeSymbols>
      <numberPatterns>
         <numberPattern name="numeric">z,zz9.zzz</numberPattern>
         <numberPattern name="currency">$z,zz9.99|($z,zz9.99)</numberPattern>
         <numberPattern name="percent">z,zz9%</numberPattern>
      </numberPatterns>
      <numberSymbols>
         <numberSymbol name="decimal">.</numberSymbol>
         <numberSymbol name="grouping">,</numberSymbol>
         <numberSymbol name="percent">%</numberSymbol>
         <numberSymbol name="minus">-</numberSymbol>
         <numberSymbol name="zero">0</numberSymbol>
      </numberSymbols>
      <currencySymbols>
         <currencySymbol name="symbol">$</currencySymbol>
         <currencySymbol name="isoname">USD</currencySymbol>
         <currencySymbol name="decimal">.</currencySymbol>
      </currencySymbols>
      <typefaces>
         <typeface name="Myriad Pro"/>
         <typeface name="Minion Pro"/>
         <typeface name="Courier Std"/>
         <typeface name="Adobe Pi Std"/>
         <typeface name="Adobe Hebrew"/>
         <typeface name="Adobe Arabic"/>
         <typeface name="Adobe Thai"/>
         <typeface name="Kozuka Gothic Pro-VI M"/>
         <typeface name="Kozuka Mincho Pro-VI R"/>
         <typeface name="Adobe Ming Std L"/>
         <typeface name="Adobe Song Std L"/>
         <typeface name="Adobe Myungjo Std M"/>
      </typefaces>
   </locale>
</localeSet>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.2-c001 63.139439, 2011/06/07-10:39:26        ">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
         <xmp:MetadataDate>2014-05-14T12:18:11Z</xmp:MetadataDate>
         <xmp:CreatorTool>Adobe LiveCycle Designer 11.0</xmp:CreatorTool>
      </rdf:Description>
      <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
         <pdf:Producer>Adobe LiveCycle Designer 11.0</pdf:Producer>
      </rdf:Description>
      <rdf:Description xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" rdf:about="">
         <xmpMM:DocumentID>uuid:08f61246-70af-40dc-becb-078a7bd860b9</xmpMM:DocumentID>
      </rdf:Description>
      <rdf:Description xmlns:desc="http://ns.adobe.com/xfa/promoted-desc/" rdf:about="">
         <desc:version rdf:parseType="Resource">
            <rdf:value>11.0.0.20130303.1.892433.887364</rdf:value>
            <desc:ref>/template/subform[1]</desc:ref>
         </desc:version>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta></xdp:xdp>