<?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>Fri, 12 Mar 2010 02:03:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Stefan Cameron</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/comment-page-3/#comment-66987</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-66987</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-page-3/#comment-66843</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-66843</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-page-3/#comment-65912</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-65912</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-page-3/#comment-65907</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-65907</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-page-3/#comment-65732</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-65732</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-page-3/#comment-65411</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-65411</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>
	<item>
		<title>By: Ralph</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/comment-page-3/#comment-65179</link>
		<dc:creator>Ralph</dc:creator>
		<pubDate>Mon, 01 Feb 2010 02:59:58 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=55#comment-65179</guid>
		<description>Hello Stef,

I&#039;m making a form that allows users to write instructions for maintenance routines.

The form has an expandable table. Each row has an &quot;Add&quot;, &quot;Delete&quot;, &quot;Up&quot; and &quot;Down&quot;. When the user presses the &quot;Add&quot; button, a new row can be added. The &quot;Delete&quot; button removes the row where the button is location. The &quot;Up&quot; and &quot;Down&quot; moves each line on step depending on the direction. I was able to program these buttons thanks to you! Your blog saved me many hours of frustration and headache. Thank You!!

However, I do have another problem. I also added a drop list that will automatically populate the table with default values depending on the choice. I used the setInstance function to change the number of rows.

Suppose the user added so many lines that the table expands to 2 pages (30 rows). Then, the user picks a value in the dropdown list that reduces the number of table rows to 12, which results in just a 1-page form. Adobe Reader proceeds to alternate between a &quot;Bad Parameter&quot; error and a &quot;Software Failure&quot; error. I&#039;m not sure what&#039;s happening.</description>
		<content:encoded><![CDATA[<p>Hello Stef,</p>
<p>I&#8217;m making a form that allows users to write instructions for maintenance routines.</p>
<p>The form has an expandable table. Each row has an &#8220;Add&#8221;, &#8220;Delete&#8221;, &#8220;Up&#8221; and &#8220;Down&#8221;. When the user presses the &#8220;Add&#8221; button, a new row can be added. The &#8220;Delete&#8221; button removes the row where the button is location. The &#8220;Up&#8221; and &#8220;Down&#8221; moves each line on step depending on the direction. I was able to program these buttons thanks to you! Your blog saved me many hours of frustration and headache. Thank You!!</p>
<p>However, I do have another problem. I also added a drop list that will automatically populate the table with default values depending on the choice. I used the setInstance function to change the number of rows.</p>
<p>Suppose the user added so many lines that the table expands to 2 pages (30 rows). Then, the user picks a value in the dropdown list that reduces the number of table rows to 12, which results in just a 1-page form. Adobe Reader proceeds to alternate between a &#8220;Bad Parameter&#8221; error and a &#8220;Software Failure&#8221; error. I&#8217;m not sure what&#8217;s happening.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/comment-page-3/#comment-64796</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Mon, 25 Jan 2010 17:12:12 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=55#comment-64796</guid>
		<description>Hi Stefan, great blog.  I have been working on a (dynamic)compliance inspection form.  Using your examples, I have been able to create this form using a repeatable subform with a &quot;addInstance&quot; button and a &#039;removeInstance&quot; button that adds a deficiency subform for each deficiency found at the site.  My issue is that once I get to the end of first page, I need the subform to flow to the top of page2, and so on.  I have been able to control the number of instances on the first page to keep it from running into my page footer,(again, using your examples) but have been unable to get the subform to flow to the next page.  I have 2 master pages created-page1 with site info and page2 as a continuence of page1.  I know I am probably overlooking something and your help would be greatly appreciated.
By the way, the form is setup the way you recommended for dynamic forms (dynamic pdf, flowed containers, etc.).</description>
		<content:encoded><![CDATA[<p>Hi Stefan, great blog.  I have been working on a (dynamic)compliance inspection form.  Using your examples, I have been able to create this form using a repeatable subform with a &#8220;addInstance&#8221; button and a &#8216;removeInstance&#8221; button that adds a deficiency subform for each deficiency found at the site.  My issue is that once I get to the end of first page, I need the subform to flow to the top of page2, and so on.  I have been able to control the number of instances on the first page to keep it from running into my page footer,(again, using your examples) but have been unable to get the subform to flow to the next page.  I have 2 master pages created-page1 with site info and page2 as a continuence of page1.  I know I am probably overlooking something and your help would be greatly appreciated.<br />
By the way, the form is setup the way you recommended for dynamic forms (dynamic pdf, flowed containers, etc.).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Cameron</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/comment-page-3/#comment-59859</link>
		<dc:creator>Stefan Cameron</dc:creator>
		<pubDate>Sun, 08 Nov 2009 22:48:19 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=55#comment-59859</guid>
		<description>Randy,

Assuming the cells enabled by the checkboxes are disabled by default and that the cells enabled by the checkboxes are in the same row as the checkboxes themselves, the script that enables a related cell when a checkbox is checked shouldn&#039;t be trying to access a particular row instance. For example, if a checkbox enables a cell named CellA, its Click event would have script that checks for its rawValue and, if equal to &quot;1&quot;, would simply do &quot;CellA.access = &#039;open&#039;;&quot;. Scoping rules would result in the CellA field pertaining to the same row in which the checkbox resides.</description>
		<content:encoded><![CDATA[<p>Randy,</p>
<p>Assuming the cells enabled by the checkboxes are disabled by default and that the cells enabled by the checkboxes are in the same row as the checkboxes themselves, the script that enables a related cell when a checkbox is checked shouldn&#8217;t be trying to access a particular row instance. For example, if a checkbox enables a cell named CellA, its Click event would have script that checks for its rawValue and, if equal to &#8220;1&#8243;, would simply do &#8220;CellA.access = &#8216;open&#8217;;&#8221;. Scoping rules would result in the CellA field pertaining to the same row in which the checkbox resides.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Randy</title>
		<link>http://forms.stefcameron.com/2006/11/11/instance-manager-object-reference/comment-page-3/#comment-59424</link>
		<dc:creator>Randy</dc:creator>
		<pubDate>Tue, 03 Nov 2009 09:37:50 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=55#comment-59424</guid>
		<description>Hello Stefan,

I have come into a problem I have been trying to figure out for the past week. I had googled for some guidance yet I found nothing useful.

Currently, I have a table which has an addinstance button and removeinstance button. The script for these work.

What I am looking to do is the row starts off being in readOnly format and when I select a checkbox, one of the cell will become open ( I have a table with 12 cell in a row and about 6-7 checkboxes which will open certain cells). However, when I add an instance and one of the checkboxes is checked...the next row is still readOnly. How do I target those certain cells? if I have a checkbox checked and I add a new row..those certain fields will be open for all the cell in that column.

If you could assist me, that would be great.

Thanks,
Randy</description>
		<content:encoded><![CDATA[<p>Hello Stefan,</p>
<p>I have come into a problem I have been trying to figure out for the past week. I had googled for some guidance yet I found nothing useful.</p>
<p>Currently, I have a table which has an addinstance button and removeinstance button. The script for these work.</p>
<p>What I am looking to do is the row starts off being in readOnly format and when I select a checkbox, one of the cell will become open ( I have a table with 12 cell in a row and about 6-7 checkboxes which will open certain cells). However, when I add an instance and one of the checkboxes is checked&#8230;the next row is still readOnly. How do I target those certain cells? if I have a checkbox checked and I add a new row..those certain fields will be open for all the cell in that column.</p>
<p>If you could assist me, that would be great.</p>
<p>Thanks,<br />
Randy</p>
]]></content:encoded>
	</item>
</channel>
</rss>
