<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Instance Manager Object Reference</title>
	<atom:link href="http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/feed/" rel="self" type="application/rss+xml" />
	<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/</link>
	<description>Building intelligent forms using Adobe LiveCycle Designer</description>
	<lastBuildDate>Thu, 19 Jan 2012 16:32:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Stefan Cameron</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/#comment-6317</link>
		<dc:creator>Stefan Cameron</dc:creator>
		<pubDate>Tue, 29 Jun 2010 14:31:29 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=55#comment-6317</guid>
		<description>@Devra Glowinski,

I&#039;m glad you find my blog useful!

Regarding flowed vs positioned subforms: To make a subform repeatable (such as the &quot;continuation pages&quot;), that subform must be &lt;i&gt;inside&lt;/i&gt; a flowed subform. The &quot;continuation page&quot; subform itself doesn&#039;t have to have flowed content (as you can see). Look at the subform that &lt;i&gt;contains&lt;/i&gt; the &quot;continuation page&quot; subform: its content should be flowed.

Regarding removing pages: You are correct in thinking that setting a minimum count would prevent instanceManager.removeInstance() from working properly. I would suggest setting the minimum to zero and the initial and max counts to 1. That would give you an instance of each page from the start and removeInstance() should work just fine after that.</description>
		<content:encoded><![CDATA[<p>@Devra Glowinski,</p>
<p>I&#8217;m glad you find my blog useful!</p>
<p>Regarding flowed vs positioned subforms: To make a subform repeatable (such as the &#8220;continuation pages&#8221;), that subform must be <i>inside</i> a flowed subform. The &#8220;continuation page&#8221; subform itself doesn&#8217;t have to have flowed content (as you can see). Look at the subform that <i>contains</i> the &#8220;continuation page&#8221; subform: its content should be flowed.</p>
<p>Regarding removing pages: You are correct in thinking that setting a minimum count would prevent instanceManager.removeInstance() from working properly. I would suggest setting the minimum to zero and the initial and max counts to 1. That would give you an instance of each page from the start and removeInstance() should work just fine after that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Devra Glowinski</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/#comment-6316</link>
		<dc:creator>Devra Glowinski</dc:creator>
		<pubDate>Sat, 19 Jun 2010 13:09:22 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=55#comment-6316</guid>
		<description>Dear Stefan,

       I have read several times now on your site that to make a subform repeatable, it must be Flowed.  And that statement does not correspond to what I am seeing in the forms I am working with.  I am fairly new to LiveCycle, so would greatly appreciate clarification.

   I have inherited several forms that have continuation pages.  These pages are full page subforms.  We start out with a minimum of 1 continuation page, but make it hidden to start.  The user then can &quot;add&quot; one continuation page, making the first continuation page visible.  From that continuation page, the user can an additional pages, which creates and additional instance with the instanceManager.

        This is working very well.  However, the properties of the continuation page is Positioned, not flowed.  So why is this working?

         Another question:  I have another form which has three pages for data entry and 12 subsequent pages which are basically text.  We have buttons on the form to allow the user to delete any specific page, or a multiple group of pages (to save paper for printing purposes, I believe).  The programmer before me accomplished this by making these &quot;deleted&quot; pages hidden, but there are a few problems with his code, and I thought I would fix the code by actually deleting the pages using instanceManager.removeInstance().

         I want all 15 pages to appear when the user first opens the form, which would mean I have a minimum count per page of 1.  However, as I understand it from your tutorials, that would prevent me from deleting the pages.  Can I set a minimum count of 0, and add the pages when the form is first created?  If not, do you have any other suggestions?

Thank you in advance for your help.  Your site is awesome and I am so glad you are willing to share your knowledge and experience with us newbies.

Devra</description>
		<content:encoded><![CDATA[<p>Dear Stefan,</p>
<p>       I have read several times now on your site that to make a subform repeatable, it must be Flowed.  And that statement does not correspond to what I am seeing in the forms I am working with.  I am fairly new to LiveCycle, so would greatly appreciate clarification.</p>
<p>   I have inherited several forms that have continuation pages.  These pages are full page subforms.  We start out with a minimum of 1 continuation page, but make it hidden to start.  The user then can &#8220;add&#8221; one continuation page, making the first continuation page visible.  From that continuation page, the user can an additional pages, which creates and additional instance with the instanceManager.</p>
<p>        This is working very well.  However, the properties of the continuation page is Positioned, not flowed.  So why is this working?</p>
<p>         Another question:  I have another form which has three pages for data entry and 12 subsequent pages which are basically text.  We have buttons on the form to allow the user to delete any specific page, or a multiple group of pages (to save paper for printing purposes, I believe).  The programmer before me accomplished this by making these &#8220;deleted&#8221; pages hidden, but there are a few problems with his code, and I thought I would fix the code by actually deleting the pages using instanceManager.removeInstance().</p>
<p>         I want all 15 pages to appear when the user first opens the form, which would mean I have a minimum count per page of 1.  However, as I understand it from your tutorials, that would prevent me from deleting the pages.  Can I set a minimum count of 0, and add the pages when the form is first created?  If not, do you have any other suggestions?</p>
<p>Thank you in advance for your help.  Your site is awesome and I am so glad you are willing to share your knowledge and experience with us newbies.</p>
<p>Devra</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Cameron</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/#comment-6315</link>
		<dc:creator>Stefan Cameron</dc:creator>
		<pubDate>Sun, 25 Apr 2010 16:00:57 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=55#comment-6315</guid>
		<description>@Haylee,

This is certainly possible, but will require some script to make it work.

Setup your table as you described it. Then select the Row2 row and make it repeatable by checking its &quot;Object palette &gt; Binding tab &gt; Repeat Row For Each Data Item property&quot;. Since all instances of a repeatable row or subform are always kept in sequence (&quot;together&quot;), this will ensure that new instances of Row2 appear after the last instance of Row2 and before Row3.

Add the &quot;Add Row&quot; button beneath the table.

Select the table and set its &quot;Object palette &gt; Table &gt; Allow Page Breaks Within Content&quot; property.

Select the page subform (named &quot;(untitled Subform) (page 1)&quot; in the Hierarchy palette) and set its &quot;Object palette &gt; Subform tab &gt; Content property&quot; to &quot;Flowed&quot;. This, combined with the previous step, will ensure that the table isn&#039;t cut-off at the bottom of the page (a new page will be generated instead) if you add enough rows to fill a page.

At this point, the table, followed by the AddRow button, should be at the top left corner of your form. Now for the scripts.

Select the AddRow button and use the Script Editor palette to set its Click event script (make sure you set the language to &quot;JavaScript&quot;):

&lt;pre&gt;&lt;code&gt;// JavaScript:
// get the last instance of Row2 to copy values from
var previousRow = Table1.resolveNode(&quot;Row2[&quot; + (Table1._Row2.count - 1) + &quot;]&quot;);

// add a new Row2 instance
var newRow = Table1._Row2.addInstance(0);

// copy values from the previous instance
newRow.TextField1.rawValue = previousRow.TextField1.rawValue;
newRow.DateTimeField1.rawValue = previousRow.DateTimeField1.rawValue;
&lt;/code&gt;&lt;/pre&gt;

The script above will add a new instance of Row2 and copy values from the last instance that was added prior to that. (Note that the names of the fields which represent the text field and date time fields in Row2 may be different for you depending on how you created your table so make sure you use the right names.)

Now select the Delete button in Row2 and set its Click event script:

&lt;pre&gt;&lt;code&gt;// JavaScript:
// delete this row only if there&#039;s more than one row left
if (Table1._Row2.count &gt; 1)
    Table1._Row2.removeInstance(this.parent.index);
&lt;/code&gt;&lt;/pre&gt;

The script above will remove the instance of Row2 to which belongs the Delete button that was clicked.</description>
		<content:encoded><![CDATA[<p>@Haylee,</p>
<p>This is certainly possible, but will require some script to make it work.</p>
<p>Setup your table as you described it. Then select the Row2 row and make it repeatable by checking its &#8220;Object palette > Binding tab > Repeat Row For Each Data Item property&#8221;. Since all instances of a repeatable row or subform are always kept in sequence (&#8220;together&#8221;), this will ensure that new instances of Row2 appear after the last instance of Row2 and before Row3.</p>
<p>Add the &#8220;Add Row&#8221; button beneath the table.</p>
<p>Select the table and set its &#8220;Object palette > Table > Allow Page Breaks Within Content&#8221; property.</p>
<p>Select the page subform (named &#8220;(untitled Subform) (page 1)&#8221; in the Hierarchy palette) and set its &#8220;Object palette > Subform tab > Content property&#8221; to &#8220;Flowed&#8221;. This, combined with the previous step, will ensure that the table isn&#8217;t cut-off at the bottom of the page (a new page will be generated instead) if you add enough rows to fill a page.</p>
<p>At this point, the table, followed by the AddRow button, should be at the top left corner of your form. Now for the scripts.</p>
<p>Select the AddRow button and use the Script Editor palette to set its Click event script (make sure you set the language to &#8220;JavaScript&#8221;):</p>
<pre><code>// JavaScript:
// get the last instance of Row2 to copy values from
var previousRow = Table1.resolveNode("Row2[" + (Table1._Row2.count - 1) + "]");

// add a new Row2 instance
var newRow = Table1._Row2.addInstance(0);

// copy values from the previous instance
newRow.TextField1.rawValue = previousRow.TextField1.rawValue;
newRow.DateTimeField1.rawValue = previousRow.DateTimeField1.rawValue;
</code></pre>
<p>The script above will add a new instance of Row2 and copy values from the last instance that was added prior to that. (Note that the names of the fields which represent the text field and date time fields in Row2 may be different for you depending on how you created your table so make sure you use the right names.)</p>
<p>Now select the Delete button in Row2 and set its Click event script:</p>
<pre><code>// JavaScript:
// delete this row only if there's more than one row left
if (Table1._Row2.count > 1)
    Table1._Row2.removeInstance(this.parent.index);
</code></pre>
<p>The script above will remove the instance of Row2 to which belongs the Delete button that was clicked.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Haylee</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/#comment-6314</link>
		<dc:creator>Haylee</dc:creator>
		<pubDate>Thu, 15 Apr 2010 20:40:50 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=55#comment-6314</guid>
		<description>Stefan,

It seems you have been able to help several people and since I&quot;m about Googled out on trying to find a solution for my problem, I would try here.

I need a table that can have static rows and then dynamically Add Rows in between the static rows.

For example, a table with 3 columns and the structure would be the following (I hope this isn&#039;t confusing):

Header
Row1 Col1 - A place holder for the rows Delete Button (this row doesn&#039;t actually have a button though because they shouldn&#039;t be able to delete it)
Row1 Col2 - A static text field
Row1 Col3 - A date/time field that the user can change
Row 2 Col1 - A Delete Button to delete the Row
Row 2 Col2 - An empty text field that the user can type in
Row2 Col3 - A date/time field that the user can change
Row3 Col1 - A place holder for the rows Delete Button (this row doesn&#039;t actually have a button though because they shouldn&#039;t be able to delete it)
Row3 Col2 - A static text field
Row3 Col3 - A date/time field that the user can change

And then underneath I have an Add button to Add a Row.  I want the rows added between Row 1 and Row 3.  So basically add a duplicate of Row 2, after Row 2.  I couldn&#039;t figure out how to add the duplicate row of Row 2 instead of Row 1.

I hope this makes sense.  It&#039;s a little hard to explain.
Thanks in advance for your help.</description>
		<content:encoded><![CDATA[<p>Stefan,</p>
<p>It seems you have been able to help several people and since I&#8221;m about Googled out on trying to find a solution for my problem, I would try here.</p>
<p>I need a table that can have static rows and then dynamically Add Rows in between the static rows.</p>
<p>For example, a table with 3 columns and the structure would be the following (I hope this isn&#8217;t confusing):</p>
<p>Header<br />
Row1 Col1 &#8211; A place holder for the rows Delete Button (this row doesn&#8217;t actually have a button though because they shouldn&#8217;t be able to delete it)<br />
Row1 Col2 &#8211; A static text field<br />
Row1 Col3 &#8211; A date/time field that the user can change<br />
Row 2 Col1 &#8211; A Delete Button to delete the Row<br />
Row 2 Col2 &#8211; An empty text field that the user can type in<br />
Row2 Col3 &#8211; A date/time field that the user can change<br />
Row3 Col1 &#8211; A place holder for the rows Delete Button (this row doesn&#8217;t actually have a button though because they shouldn&#8217;t be able to delete it)<br />
Row3 Col2 &#8211; A static text field<br />
Row3 Col3 &#8211; A date/time field that the user can change</p>
<p>And then underneath I have an Add button to Add a Row.  I want the rows added between Row 1 and Row 3.  So basically add a duplicate of Row 2, after Row 2.  I couldn&#8217;t figure out how to add the duplicate row of Row 2 instead of Row 1.</p>
<p>I hope this makes sense.  It&#8217;s a little hard to explain.<br />
Thanks in advance for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Cameron</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/#comment-6313</link>
		<dc:creator>Stefan Cameron</dc:creator>
		<pubDate>Wed, 03 Mar 2010 22:41:02 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=55#comment-6313</guid>
		<description>Mike S,

It sounds like you&#039;re previewing as a Static (non-interactive) PDF rather than a Dynamic PDF.

The Instance Manager will only work in Dynamic PDFs. See &lt;a href=&quot;http://forms.stefcameron.com/2006/07/24/previewing-as-dynamic-pdf/&quot; rel=&quot;nofollow&quot;&gt;this post&lt;/a&gt; on how to ensure you&#039;re previewing as a Dynamic PDF.</description>
		<content:encoded><![CDATA[<p>Mike S,</p>
<p>It sounds like you&#8217;re previewing as a Static (non-interactive) PDF rather than a Dynamic PDF.</p>
<p>The Instance Manager will only work in Dynamic PDFs. See <a href="http://forms.stefcameron.com/2006/07/24/previewing-as-dynamic-pdf/" rel="nofollow">this post</a> on how to ensure you&#8217;re previewing as a Dynamic PDF.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike S</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/#comment-6312</link>
		<dc:creator>Mike S</dc:creator>
		<pubDate>Mon, 01 Mar 2010 22:39:28 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=55#comment-6312</guid>
		<description>Stefan,

Have you ever seen instanceManager not work at all.  I started with a blank form and added a table just as the scripting refernce instructed and the button does nothing.  I do not even get an error or something to point me in a direction.
form is dynamic, page is flowable, table with one header row, and dynamic body rows - used the assistant to create, added the script Table1._Row1..... with and without instanceManager ...   .addInstance(1);

nothing - the button clicks and that is it.


I have an older form that adds rows and it works inside designer.  I tried copying that over into another form but nothing.

Any suggestions would be appreciated.</description>
		<content:encoded><![CDATA[<p>Stefan,</p>
<p>Have you ever seen instanceManager not work at all.  I started with a blank form and added a table just as the scripting refernce instructed and the button does nothing.  I do not even get an error or something to point me in a direction.<br />
form is dynamic, page is flowable, table with one header row, and dynamic body rows &#8211; used the assistant to create, added the script Table1._Row1&#8230;.. with and without instanceManager &#8230;   .addInstance(1);</p>
<p>nothing &#8211; the button clicks and that is it.</p>
<p>I have an older form that adds rows and it works inside designer.  I tried copying that over into another form but nothing.</p>
<p>Any suggestions would be appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Cameron</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/#comment-6311</link>
		<dc:creator>Stefan Cameron</dc:creator>
		<pubDate>Fri, 12 Feb 2010 03:24:55 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=55#comment-6311</guid>
		<description>Tim,

Perhaps you &lt;i&gt;are&lt;/i&gt; running into the issue where your table is being &quot;cut-off&quot; at the bottom of your page (and might even be running over top your footer) instead of flowing onto the next page.

If you have 2 master pages just so that you can have 2 pages, that&#039;s not necessary. A master page is simply the &quot;background&quot; to all the body pages. You can get fancy and create different master pages with different setups like multi-columns, headers, footers, etc., and have body form objects flow between various master pages but that sounds way more complex than what you&#039;re trying to accomplish.

I would start by deleting the second master page.

Then, make sure your table is allows to break between pages by checking the &quot;Object palette &gt; Table tab &gt; Allow page breaks within content&quot;.

Finally, make sure your table is within a &lt;i&gt;flowed&lt;/i&gt; container. This will ensure that anything below your table flows down nicely as you add rows.

As for your footer, make sure the content area object on the master page doesn&#039;t overlap your footer, otherwise body content will flow over top of it. The content area object on the master page defines where body content can flow within the page.

The dynamic form portions of my &lt;a href=&quot;http://forms.stefcameron.com/max2007/&quot; rel=&quot;nofollow&quot;&gt;MAX 2007 tutorial&lt;/a&gt; explain this in depth.</description>
		<content:encoded><![CDATA[<p>Tim,</p>
<p>Perhaps you <i>are</i> running into the issue where your table is being &#8220;cut-off&#8221; at the bottom of your page (and might even be running over top your footer) instead of flowing onto the next page.</p>
<p>If you have 2 master pages just so that you can have 2 pages, that&#8217;s not necessary. A master page is simply the &#8220;background&#8221; to all the body pages. You can get fancy and create different master pages with different setups like multi-columns, headers, footers, etc., and have body form objects flow between various master pages but that sounds way more complex than what you&#8217;re trying to accomplish.</p>
<p>I would start by deleting the second master page.</p>
<p>Then, make sure your table is allows to break between pages by checking the &#8220;Object palette > Table tab > Allow page breaks within content&#8221;.</p>
<p>Finally, make sure your table is within a <i>flowed</i> container. This will ensure that anything below your table flows down nicely as you add rows.</p>
<p>As for your footer, make sure the content area object on the master page doesn&#8217;t overlap your footer, otherwise body content will flow over top of it. The content area object on the master page defines where body content can flow within the page.</p>
<p>The dynamic form portions of my <a href="http://forms.stefcameron.com/max2007/" rel="nofollow">MAX 2007 tutorial</a> explain this in depth.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Cameron</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/#comment-6310</link>
		<dc:creator>Stefan Cameron</dc:creator>
		<pubDate>Fri, 12 Feb 2010 02:53:23 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=55#comment-6310</guid>
		<description>Ralph,

Thanks for letting me know how much my tutorial helped you out!

&lt;blockquote&gt;Adobe Reader proceeds to alternate between a “Bad Parameter” error and a “Software Failure” error. I’m not sure what’s happening.&lt;/blockquote&gt;

I don&#039;t recall ever seeing such an error. Can you isolate the line of script that seems to cause it? Perhaps you should try setting the number of instances to 0, the setting it to what it should be? That might make a difference.

Tables should be able to span pages provided you checked the &quot;Allow page breaks within content&quot; property on the &quot;Object palette &gt; Table tab&quot;.</description>
		<content:encoded><![CDATA[<p>Ralph,</p>
<p>Thanks for letting me know how much my tutorial helped you out!</p>
<blockquote><p>Adobe Reader proceeds to alternate between a “Bad Parameter” error and a “Software Failure” error. I’m not sure what’s happening.</p></blockquote>
<p>I don&#8217;t recall ever seeing such an error. Can you isolate the line of script that seems to cause it? Perhaps you should try setting the number of instances to 0, the setting it to what it should be? That might make a difference.</p>
<p>Tables should be able to span pages provided you checked the &#8220;Allow page breaks within content&#8221; property on the &#8220;Object palette > Table tab&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/#comment-6309</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Mon, 08 Feb 2010 14:10:56 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=55#comment-6309</guid>
		<description>Thank you for your response.  As instructed, I selected the &quot;Go To Page&quot; option with some undesired results.  I played with some of the other settings on the SF object pallete without success.  There may be some things in the code causing conflict, I copied and pasted most of it and changed things to suite my form.  It may be a little overkill, but I&#039;m learning.  See if I am on the right track.

dataroot.MainPage.SF1.SiteObSF.Dk-SpFld::initialize - (JavaScript, client)
/*	This listbox object will populate two columns with data from a data connection.

	sDataConnectionName - name of the data connection to get the data from.  Note the data connection will appear in the Data View.
	sColHiddenValue 	- this is the hidden value column of the listbox.  Specify the table column name used for populating.
	sColDisplayText		- this is the display text column of the listbox.  Specify the table column name used for populating.

	These variables must be assigned for this script to run correctly.  Replace  with the correct value.
*/

var sDataConnectionName = &quot;&lt; value &amp;lt&quot;;		//	example - var sDataConnectionName = &quot;MyDataConnection&quot;;
var sColHiddenValue = &quot;&lt; value &lt;&quot;;			//	example - var sColHiddenValue = &quot;MyIndexValue&quot;;
var sColDisplayText = &quot;&lt; value &lt;&quot;;			//	example - var sColDisplayText = &quot;MyDescription&quot;


//	Search for sourceSet node which matchs the DataConnection name
var nIndex = 0;
while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)
{
	nIndex++;
}

var oDB = xfa.sourceSet.nodes.item(nIndex).clone(1);
oDB.open();
oDB.first();

//	Search node with the class name &quot;command&quot;
var nDBIndex = 0;
while(oDB.nodes.item(nDBIndex).className != &quot;command&quot;)
{
	nDBIndex++;
}

//	Backup the original settings before assigning BOF and EOF to stay
var sBOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute(&quot;bofAction&quot;);
var sEOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute(&quot;eofAction&quot;);

oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(&quot;stayBOF&quot;, &quot;bofAction&quot;);
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(&quot;stayEOF&quot;, &quot;eofAction&quot;);

//	Clear the list
this.clearItems();

//	Search for the record node with the matching Data Connection name
nIndex = 0;
while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)
{
	nIndex++;
}
var oRecord = xfa.record.nodes.item(nIndex);

//	Find the value node
var oValueNode = null;
var oTextNode = null;
for(var nColIndex = 0; nColIndex &lt; oRecord.nodes.length; nColIndex++)
{
	if(oRecord.nodes.item(nColIndex).name == sColHiddenValue)
	{
		oValueNode = oRecord.nodes.item(nColIndex);
	}
	if(oRecord.nodes.item(nColIndex).name == sColDisplayText)
	{
		oTextNode = oRecord.nodes.item(nColIndex);
	}
}

while(!oDB.isEOF())
{
 	this.addItem(oTextNode.value, oValueNode.value);
  	oDB.next();
}

//	Restore the original settings
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup, &quot;bofAction&quot;);
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup, &quot;eofAction&quot;);

//	Close connection
oDB.close();
 dataroot.MainPage.SF1.SiteObSF.CatFld::initialize - (JavaScript, client)
/*	This dropdown list object will populate two columns with data from a data connection.

	sDataConnectionName - name of the data connection to get the data from.  Note the data connection will appear in the Data View.
	sColHiddenValue 	- this is the hidden value column of the dropdown.  Specify the table column name used for populating.
	sColDisplayText		- this is the display text column of the dropdown.  Specify the table column name used for populating.

	These variables must be assigned for this script to run correctly.  Replace &lt; value &lt; with the correct value.
*/

var sDataConnectionName = &quot;&lt; value &lt;&quot;;		//	example - var sDataConnectionName = &quot;MyDataConnection&quot;;
var sColHiddenValue = &quot;&lt; value &lt;&quot;;			//	example - var sColHiddenValue = &quot;MyIndexValue&quot;;
var sColDisplayText = &quot;&lt; value &lt;&quot;;			//	example - var sColDisplayText = &quot;MyDescription&quot;


//	Search for sourceSet node which matchs the DataConnection name
var nIndex = 0;
while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)
{
	nIndex++;
}

var oDB = xfa.sourceSet.nodes.item(nIndex).clone(1);
oDB.open();
oDB.first();

//	Search node with the class name &quot;command&quot;
var nDBIndex = 0;
while(oDB.nodes.item(nDBIndex).className != &quot;command&quot;)
{
	nDBIndex++;
}

//	Backup the original settings before assigning BOF and EOF to stay
var sBOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute(&quot;bofAction&quot;);
var sEOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute(&quot;eofAction&quot;);

oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(&quot;stayBOF&quot;, &quot;bofAction&quot;);
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(&quot;stayEOF&quot;, &quot;eofAction&quot;);

//	Clear the list
this.clearItems();

//	Search for the record node with the matching Data Connection name
nIndex = 0;
while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)
{
	nIndex++;
}
var oRecord = xfa.record.nodes.item(nIndex);

//	Find the value node
var oValueNode = null;
var oTextNode = null;
for(var nColIndex = 0; nColIndex &lt; oRecord.nodes.length; nColIndex++)
{
	if(oRecord.nodes.item(nColIndex).name == sColHiddenValue)
	{
		oValueNode = oRecord.nodes.item(nColIndex);
	}
	if(oRecord.nodes.item(nColIndex).name == sColDisplayText)
	{
		oTextNode = oRecord.nodes.item(nColIndex);
	}
}

while(!oDB.isEOF())
{
 	this.addItem(oTextNode.value, oValueNode.value);
  	oDB.next();
}

//	Restore the original settings
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup, &quot;bofAction&quot;);
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup, &quot;eofAction&quot;);

//	Close connection
oDB.close();
 dataroot.MainPage.SF1.SiteObSF.ObDesFld::initialize - (JavaScript, client)
/*	This listbox object will populate two columns with data from a data connection.

	sDataConnectionName - name of the data connection to get the data from.  Note the data connection will appear in the Data View.
	sColHiddenValue 	- this is the hidden value column of the listbox.  Specify the table column name used for populating.
	sColDisplayText		- this is the display text column of the listbox.  Specify the table column name used for populating.

	These variables must be assigned for this script to run correctly.  Replace &lt; value &lt; with the correct value.
*/

var sDataConnectionName = &quot;&lt; value &lt;&quot;;		//	example - var sDataConnectionName = &quot;MyDataConnection&quot;;
var sColHiddenValue = &quot;&lt; value &lt;&quot;;			//	example - var sColHiddenValue = &quot;MyIndexValue&quot;;
var sColDisplayText = &quot;&lt; value &lt;&quot;;			//	example - var sColDisplayText = &quot;MyDescription&quot;


//	Search for sourceSet node which matchs the DataConnection name
var nIndex = 0;
while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)
{
	nIndex++;
}

var oDB = xfa.sourceSet.nodes.item(nIndex).clone(1);
oDB.open();
oDB.first();

//	Search node with the class name &quot;command&quot;
var nDBIndex = 0;
while(oDB.nodes.item(nDBIndex).className != &quot;command&quot;)
{
	nDBIndex++;
}

//	Backup the original settings before assigning BOF and EOF to stay
var sBOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute(&quot;bofAction&quot;);
var sEOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute(&quot;eofAction&quot;);

oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(&quot;stayBOF&quot;, &quot;bofAction&quot;);
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(&quot;stayEOF&quot;, &quot;eofAction&quot;);

//	Clear the list
this.clearItems();

//	Search for the record node with the matching Data Connection name
nIndex = 0;
while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)
{
	nIndex++;
}
var oRecord = xfa.record.nodes.item(nIndex);

//	Find the value node
var oValueNode = null;
var oTextNode = null;
for(var nColIndex = 0; nColIndex &lt; oRecord.nodes.length; nColIndex++)
{
	if(oRecord.nodes.item(nColIndex).name == sColHiddenValue)
	{
		oValueNode = oRecord.nodes.item(nColIndex);
	}
	if(oRecord.nodes.item(nColIndex).name == sColDisplayText)
	{
		oTextNode = oRecord.nodes.item(nColIndex);
	}
}

while(!oDB.isEOF())
{
 	this.addItem(oTextNode.value, oValueNode.value);
  	oDB.next();
}

//	Restore the original settings
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup, &quot;bofAction&quot;);
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup, &quot;eofAction&quot;);

//	Close connection
oDB.close();
 dataroot.MainPage.SF1.SiteObSF.AddSubform::click - (JavaScript, client)
// nSubLength stores the number of XML elements contained in SF1.
var nSubLength = SF1.nodes.length;

// nNumSub is used to calculate the number of subform objects contained in SF1.
var nNumSub = 0;

// This script uses a For loop to cycle through all of the objects contained
// in SF1.
for (var nCount = 0; nCount &lt; nSubLength; nCount ++) {

// If the current XML element in Subform1 is of type subform, then increment
// the variable nNumSub by one.
	if (SiteObSF.nodes.item(nCount).className == &quot;SiteObSF&quot;) {
		nNumSub = nNumSub + 1;
}
}

// An if-else statement is used to prevent form authors from adding more than the
// maximum number of four subform instances to a form.
if (nNumSub == 4) {
xfa.host.messageBox(&quot;Click Add Page for more Descrepencies&quot;, &quot;Attention&quot;, 3);
}
else {

// This script uses the addInstance() method to add a new instance of the
// SiteObSF object contained in SF1.
SF1.SiteObSF.instanceManager.addInstance(1);
}
xfa.form.recalculate(true)

 dataroot.MainPage.SF1.SiteObSF.RemoveSubform::click - (JavaScript, client)
var nNumSub = 0;
var nSubLength = SF1.nodes.length;
SF1.SiteObSF.instanceManager.removeInstance(nNumSub);

I can email a copy of the form if you like.

Tim</description>
		<content:encoded><![CDATA[<p>Thank you for your response.  As instructed, I selected the &#8220;Go To Page&#8221; option with some undesired results.  I played with some of the other settings on the SF object pallete without success.  There may be some things in the code causing conflict, I copied and pasted most of it and changed things to suite my form.  It may be a little overkill, but I&#8217;m learning.  See if I am on the right track.</p>
<p>dataroot.MainPage.SF1.SiteObSF.Dk-SpFld::initialize &#8211; (JavaScript, client)<br />
/*	This listbox object will populate two columns with data from a data connection.</p>
<p>	sDataConnectionName &#8211; name of the data connection to get the data from.  Note the data connection will appear in the Data View.<br />
	sColHiddenValue 	- this is the hidden value column of the listbox.  Specify the table column name used for populating.<br />
	sColDisplayText		- this is the display text column of the listbox.  Specify the table column name used for populating.</p>
<p>	These variables must be assigned for this script to run correctly.  Replace  with the correct value.<br />
*/</p>
<p>var sDataConnectionName = &#8220;&lt; value &amp;lt&#8221;;		//	example &#8211; var sDataConnectionName = &#8220;MyDataConnection&#8221;;<br />
var sColHiddenValue = &#8220;&lt; value &lt;&#8221;;			//	example &#8211; var sColHiddenValue = &#8220;MyIndexValue&#8221;;<br />
var sColDisplayText = &#8220;&lt; value &lt;&#8221;;			//	example &#8211; var sColDisplayText = &#8220;MyDescription&#8221;</p>
<p>//	Search for sourceSet node which matchs the DataConnection name<br />
var nIndex = 0;<br />
while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)<br />
{<br />
	nIndex++;<br />
}</p>
<p>var oDB = xfa.sourceSet.nodes.item(nIndex).clone(1);<br />
oDB.open();<br />
oDB.first();</p>
<p>//	Search node with the class name &#8220;command&#8221;<br />
var nDBIndex = 0;<br />
while(oDB.nodes.item(nDBIndex).className != &#8220;command&#8221;)<br />
{<br />
	nDBIndex++;<br />
}</p>
<p>//	Backup the original settings before assigning BOF and EOF to stay<br />
var sBOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute(&#8220;bofAction&#8221;);<br />
var sEOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute(&#8220;eofAction&#8221;);</p>
<p>oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(&#8220;stayBOF&#8221;, &#8220;bofAction&#8221;);<br />
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(&#8220;stayEOF&#8221;, &#8220;eofAction&#8221;);</p>
<p>//	Clear the list<br />
this.clearItems();</p>
<p>//	Search for the record node with the matching Data Connection name<br />
nIndex = 0;<br />
while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)<br />
{<br />
	nIndex++;<br />
}<br />
var oRecord = xfa.record.nodes.item(nIndex);</p>
<p>//	Find the value node<br />
var oValueNode = null;<br />
var oTextNode = null;<br />
for(var nColIndex = 0; nColIndex &lt; oRecord.nodes.length; nColIndex++)<br />
{<br />
	if(oRecord.nodes.item(nColIndex).name == sColHiddenValue)<br />
	{<br />
		oValueNode = oRecord.nodes.item(nColIndex);<br />
	}<br />
	if(oRecord.nodes.item(nColIndex).name == sColDisplayText)<br />
	{<br />
		oTextNode = oRecord.nodes.item(nColIndex);<br />
	}<br />
}</p>
<p>while(!oDB.isEOF())<br />
{<br />
 	this.addItem(oTextNode.value, oValueNode.value);<br />
  	oDB.next();<br />
}</p>
<p>//	Restore the original settings<br />
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup, &#8220;bofAction&#8221;);<br />
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup, &#8220;eofAction&#8221;);</p>
<p>//	Close connection<br />
oDB.close();<br />
 dataroot.MainPage.SF1.SiteObSF.CatFld::initialize &#8211; (JavaScript, client)<br />
/*	This dropdown list object will populate two columns with data from a data connection.</p>
<p>	sDataConnectionName &#8211; name of the data connection to get the data from.  Note the data connection will appear in the Data View.<br />
	sColHiddenValue 	- this is the hidden value column of the dropdown.  Specify the table column name used for populating.<br />
	sColDisplayText		- this is the display text column of the dropdown.  Specify the table column name used for populating.</p>
<p>	These variables must be assigned for this script to run correctly.  Replace &lt; value &lt; with the correct value.<br />
*/</p>
<p>var sDataConnectionName = &#8220;&lt; value &lt;&#8221;;		//	example &#8211; var sDataConnectionName = &#8220;MyDataConnection&#8221;;<br />
var sColHiddenValue = &#8220;&lt; value &lt;&#8221;;			//	example &#8211; var sColHiddenValue = &#8220;MyIndexValue&#8221;;<br />
var sColDisplayText = &#8220;&lt; value &lt;&#8221;;			//	example &#8211; var sColDisplayText = &#8220;MyDescription&#8221;</p>
<p>//	Search for sourceSet node which matchs the DataConnection name<br />
var nIndex = 0;<br />
while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)<br />
{<br />
	nIndex++;<br />
}</p>
<p>var oDB = xfa.sourceSet.nodes.item(nIndex).clone(1);<br />
oDB.open();<br />
oDB.first();</p>
<p>//	Search node with the class name &#8220;command&#8221;<br />
var nDBIndex = 0;<br />
while(oDB.nodes.item(nDBIndex).className != &#8220;command&#8221;)<br />
{<br />
	nDBIndex++;<br />
}</p>
<p>//	Backup the original settings before assigning BOF and EOF to stay<br />
var sBOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute(&#8220;bofAction&#8221;);<br />
var sEOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute(&#8220;eofAction&#8221;);</p>
<p>oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(&#8220;stayBOF&#8221;, &#8220;bofAction&#8221;);<br />
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(&#8220;stayEOF&#8221;, &#8220;eofAction&#8221;);</p>
<p>//	Clear the list<br />
this.clearItems();</p>
<p>//	Search for the record node with the matching Data Connection name<br />
nIndex = 0;<br />
while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)<br />
{<br />
	nIndex++;<br />
}<br />
var oRecord = xfa.record.nodes.item(nIndex);</p>
<p>//	Find the value node<br />
var oValueNode = null;<br />
var oTextNode = null;<br />
for(var nColIndex = 0; nColIndex &lt; oRecord.nodes.length; nColIndex++)<br />
{<br />
	if(oRecord.nodes.item(nColIndex).name == sColHiddenValue)<br />
	{<br />
		oValueNode = oRecord.nodes.item(nColIndex);<br />
	}<br />
	if(oRecord.nodes.item(nColIndex).name == sColDisplayText)<br />
	{<br />
		oTextNode = oRecord.nodes.item(nColIndex);<br />
	}<br />
}</p>
<p>while(!oDB.isEOF())<br />
{<br />
 	this.addItem(oTextNode.value, oValueNode.value);<br />
  	oDB.next();<br />
}</p>
<p>//	Restore the original settings<br />
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup, &#8220;bofAction&#8221;);<br />
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup, &#8220;eofAction&#8221;);</p>
<p>//	Close connection<br />
oDB.close();<br />
 dataroot.MainPage.SF1.SiteObSF.ObDesFld::initialize &#8211; (JavaScript, client)<br />
/*	This listbox object will populate two columns with data from a data connection.</p>
<p>	sDataConnectionName &#8211; name of the data connection to get the data from.  Note the data connection will appear in the Data View.<br />
	sColHiddenValue 	- this is the hidden value column of the listbox.  Specify the table column name used for populating.<br />
	sColDisplayText		- this is the display text column of the listbox.  Specify the table column name used for populating.</p>
<p>	These variables must be assigned for this script to run correctly.  Replace &lt; value &lt; with the correct value.<br />
*/</p>
<p>var sDataConnectionName = &#8220;&lt; value &lt;&#8221;;		//	example &#8211; var sDataConnectionName = &#8220;MyDataConnection&#8221;;<br />
var sColHiddenValue = &#8220;&lt; value &lt;&#8221;;			//	example &#8211; var sColHiddenValue = &#8220;MyIndexValue&#8221;;<br />
var sColDisplayText = &#8220;&lt; value &lt;&#8221;;			//	example &#8211; var sColDisplayText = &#8220;MyDescription&#8221;</p>
<p>//	Search for sourceSet node which matchs the DataConnection name<br />
var nIndex = 0;<br />
while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)<br />
{<br />
	nIndex++;<br />
}</p>
<p>var oDB = xfa.sourceSet.nodes.item(nIndex).clone(1);<br />
oDB.open();<br />
oDB.first();</p>
<p>//	Search node with the class name &#8220;command&#8221;<br />
var nDBIndex = 0;<br />
while(oDB.nodes.item(nDBIndex).className != &#8220;command&#8221;)<br />
{<br />
	nDBIndex++;<br />
}</p>
<p>//	Backup the original settings before assigning BOF and EOF to stay<br />
var sBOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute(&#8220;bofAction&#8221;);<br />
var sEOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute(&#8220;eofAction&#8221;);</p>
<p>oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(&#8220;stayBOF&#8221;, &#8220;bofAction&#8221;);<br />
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(&#8220;stayEOF&#8221;, &#8220;eofAction&#8221;);</p>
<p>//	Clear the list<br />
this.clearItems();</p>
<p>//	Search for the record node with the matching Data Connection name<br />
nIndex = 0;<br />
while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)<br />
{<br />
	nIndex++;<br />
}<br />
var oRecord = xfa.record.nodes.item(nIndex);</p>
<p>//	Find the value node<br />
var oValueNode = null;<br />
var oTextNode = null;<br />
for(var nColIndex = 0; nColIndex &lt; oRecord.nodes.length; nColIndex++)<br />
{<br />
	if(oRecord.nodes.item(nColIndex).name == sColHiddenValue)<br />
	{<br />
		oValueNode = oRecord.nodes.item(nColIndex);<br />
	}<br />
	if(oRecord.nodes.item(nColIndex).name == sColDisplayText)<br />
	{<br />
		oTextNode = oRecord.nodes.item(nColIndex);<br />
	}<br />
}</p>
<p>while(!oDB.isEOF())<br />
{<br />
 	this.addItem(oTextNode.value, oValueNode.value);<br />
  	oDB.next();<br />
}</p>
<p>//	Restore the original settings<br />
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup, &quot;bofAction&quot;);<br />
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup, &quot;eofAction&quot;);</p>
<p>//	Close connection<br />
oDB.close();<br />
 dataroot.MainPage.SF1.SiteObSF.AddSubform::click &#8211; (JavaScript, client)<br />
// nSubLength stores the number of XML elements contained in SF1.<br />
var nSubLength = SF1.nodes.length;</p>
<p>// nNumSub is used to calculate the number of subform objects contained in SF1.<br />
var nNumSub = 0;</p>
<p>// This script uses a For loop to cycle through all of the objects contained<br />
// in SF1.<br />
for (var nCount = 0; nCount &lt; nSubLength; nCount ++) {</p>
<p>// If the current XML element in Subform1 is of type subform, then increment<br />
// the variable nNumSub by one.<br />
	if (SiteObSF.nodes.item(nCount).className == &quot;SiteObSF&quot;) {<br />
		nNumSub = nNumSub + 1;<br />
}<br />
}</p>
<p>// An if-else statement is used to prevent form authors from adding more than the<br />
// maximum number of four subform instances to a form.<br />
if (nNumSub == 4) {<br />
xfa.host.messageBox(&quot;Click Add Page for more Descrepencies&quot;, &quot;Attention&quot;, 3);<br />
}<br />
else {</p>
<p>// This script uses the addInstance() method to add a new instance of the<br />
// SiteObSF object contained in SF1.<br />
SF1.SiteObSF.instanceManager.addInstance(1);<br />
}<br />
xfa.form.recalculate(true)</p>
<p> dataroot.MainPage.SF1.SiteObSF.RemoveSubform::click &#8211; (JavaScript, client)<br />
var nNumSub = 0;<br />
var nSubLength = SF1.nodes.length;<br />
SF1.SiteObSF.instanceManager.removeInstance(nNumSub);</p>
<p>I can email a copy of the form if you like.</p>
<p>Tim</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Cameron</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/#comment-6308</link>
		<dc:creator>Stefan Cameron</dc:creator>
		<pubDate>Wed, 03 Feb 2010 17:19:27 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=55#comment-6308</guid>
		<description>Tim,

Since you point-out that your form is setup using flowed containers, I&#039;m going to assume the issue isn&#039;t about the subform instance being &quot;cut-off&quot; at the bottom of Page1 but rather that it flows into another instance of the Page1 master page rather than flowing into a Page2 master page.

In this case, you need to specify where new instances of the repeatable deficiency subform should be placed once Page1 overflows. You can do this by selecting the deficiency subform and setting its &quot;Object palette &gt; Pagination tab &gt; After property&quot; to &quot;Go To Page &gt; Page2&quot;.</description>
		<content:encoded><![CDATA[<p>Tim,</p>
<p>Since you point-out that your form is setup using flowed containers, I&#8217;m going to assume the issue isn&#8217;t about the subform instance being &#8220;cut-off&#8221; at the bottom of Page1 but rather that it flows into another instance of the Page1 master page rather than flowing into a Page2 master page.</p>
<p>In this case, you need to specify where new instances of the repeatable deficiency subform should be placed once Page1 overflows. You can do this by selecting the deficiency subform and setting its &#8220;Object palette > Pagination tab > After property&#8221; to &#8220;Go To Page > Page2&#8243;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

