<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Stefan Cameron on Forms &#187; Debugging</title>
	<atom:link href="http://forms.stefcameron.com/category/debugging/feed/" rel="self" type="application/rss+xml" />
	<link>http://forms.stefcameron.com</link>
	<description>Building intelligent forms using Adobe LiveCycle Designer</description>
	<lastBuildDate>Wed, 16 Feb 2011 22:56:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Acrobat JavaScript Debugger on XFA Forms</title>
		<link>http://forms.stefcameron.com/2010/03/12/acrobat-javascript-debugger-on-xfa-forms/</link>
		<comments>http://forms.stefcameron.com/2010/03/12/acrobat-javascript-debugger-on-xfa-forms/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 17:14:30 +0000</pubDate>
		<dc:creator>Stefan Cameron</dc:creator>
				<category><![CDATA[Acrobat]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[XFA]]></category>

		<guid isPermaLink="false">http://forms.stefcameron.com/?p=526</guid>
		<description><![CDATA[Many of you have been requesting some debugging features for XFA Forms (and I&#8217;m sure many more of you just haven&#8217;t voted for it yet). It so happens that Acrobat Pro has a JavaScript Debugger which can be used &#8212; to a limited extent &#8212; with XFA Forms. See John Brinkman&#8217;s post to learn more [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://forms.stefcameron.com/featur-o-meter/">Many of you</a> have been requesting some debugging features for XFA Forms (and I&#8217;m sure many more of you just haven&#8217;t voted for it yet). It so happens that Acrobat Pro has a <strong>JavaScript Debugger</strong> which can be used &#8212; to a <strong>limited</strong> extent &#8212; with XFA Forms. See <a href="http://blogs.adobe.com/formfeed/2010/03/using_the_acrobat_javascript_d.html">John Brinkman&#8217;s post</a> to learn more about it &#8212; thanks John!</p>
<p>As he puts it, <strong>there are limitations</strong>, the biggest ones of them being, in my opinion, the inability to debug script objects and the inability to retain breakpoints between debugging sessions. Nonetheless, this tool can give you way more insight than the good old &#8220;<a href="http://forms.stefcameron.com/2006/05/05/debugging-scripts/">JavaScript Console</a> + <a href="http://forms.stefcameron.com/2009/08/19/tip-pretty-xml-strings/">saveXML(&#8216;pretty&#8217;)</a>&#8221; combination can in certain cases, and it does it in a nice tree to boot!</p>
]]></content:encoded>
			<wfw:commentRss>http://forms.stefcameron.com/2010/03/12/acrobat-javascript-debugger-on-xfa-forms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing HTTP Submit Buttons</title>
		<link>http://forms.stefcameron.com/2009/12/16/testing-http-submit-buttons/</link>
		<comments>http://forms.stefcameron.com/2009/12/16/testing-http-submit-buttons/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 18:08:08 +0000</pubDate>
		<dc:creator>Stefan Cameron</dc:creator>
				<category><![CDATA[Data Binding]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Tables]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[XFA]]></category>

		<guid isPermaLink="false">http://forms.stefcameron.com/2009/12/16/testing-http-submit-buttons/</guid>
		<description><![CDATA[While recently helping a few people with some issues related to HTTP submissions from XFA forms, I ended-up creating new Data Service that helps with testing HTTP Submit Buttons. The service is quite simple: It displays what you submit to it. Since Designer&#8217;s &#8220;PDF Preview&#8221; tab is actually an instance of Internet Explorer hosting a [...]]]></description>
			<content:encoded><![CDATA[<p>While recently helping a few people with some issues related to HTTP submissions from XFA forms, I ended-up creating new <a href="http://forms.stefcameron.com/data-services/">Data Service</a> that helps with <a href="http://forms.stefcameron.com/services/http-submit-test/">testing HTTP Submit Buttons</a>.</p>
<p>The service is quite simple: It displays what you submit to it. Since Designer&#8217;s &#8220;PDF Preview&#8221; tab is actually an instance of Internet Explorer hosting a PDF version of the form you&#8217;re previewing (a temporary PDF if your form is saved as an XDP or is new), the results are conveniently displayed within the tab itself after clicking on the submit button.</p>
<p>To use the service, simply use either an http submit button (or a regular button with its &#8220;Object palette &gt; Field tab &gt; Control Type property&#8221; set to &#8220;Submit&#8221;) and set its URL to:</p>
<p><a href="http://forms.stefcameron.com/services/http-submit-test/">http://forms.stefcameron.com/services/http-submit-test/</a></p>
<p>The idea is to use this service as a means to test/debug your forms before spending time writing the actual server code that will receive the data. You can also use it to ensure that you are submitting the correct data to a third-party service (for which you don&#8217;t control the server-side code).</p>
<p><span id="more-484"></span><br />
<h2>Choosing a Submit Format</h2>
<p>HTTP submissions can be made in various formats: XML, XDP, URL-encoded (HTTP post), and PDF. If you are using Reader instead of Acrobat, you will not be able to submit in PDF format unless you have enabled this ability using <a href="http://www.adobe.com/products/livecycle/readerextensions/">LC Reader Extensions</a>.</p>
<p>The most important difference amongst the formats is that <strong>repeating data sets cannot be submitted using URL-encoding</strong> (HTTP post). This is due to the way the data is submitted: In HTTP post directives, data is submitted in &#8220;name=value&#8221; pairs. Since repeating data sets involve hierarchy and duplicate data node names, only the last instance of the repeating set will be submitted.</p>
<p>To submit repeating data sets, you must choose either XML, XDP or PDF as the data format.</p>
<h2>Sample Form</h2>
<p>The following sample form demonstrates the use of the HTTP Submit Test service.</p>
<p><a href="http://forms.stefcameron.com/samples/data-binding/HttpSubmitTest.pdf">Download Sample [pdf]</a>
<p>The form has a typical address block as well as a table to demonstrate both static and repeating data sets. Use the submit buttons to try submitting in different formats (XML, XDP, PDF, URL-encoded). Notice how only the last table row is submitted when using the URL-encoded (&#8220;post&#8221;) submit button.
<p><strong>Minimum Sample Requirements:</strong> I created this sample using Designer 9.0 and Acrobat 9.2 however it should work fine back to Acrobat 7.0.5.</p>
]]></content:encoded>
			<wfw:commentRss>http://forms.stefcameron.com/2009/12/16/testing-http-submit-buttons/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Tip: Pretty XML Strings</title>
		<link>http://forms.stefcameron.com/2009/08/19/tip-pretty-xml-strings/</link>
		<comments>http://forms.stefcameron.com/2009/08/19/tip-pretty-xml-strings/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 12:50:21 +0000</pubDate>
		<dc:creator>Stefan Cameron</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://forms.stefcameron.com/2009/08/19/tip-pretty-xml-strings/</guid>
		<description><![CDATA[I regularly use the saveXML() method, available on all node class-based objects, as a way to debug my forms (think of it as a type of introspection technique). The method outputs a string representation of the XML content of the node in question, which helps when attempting to discover the underlying object structure without a [...]]]></description>
			<content:encoded><![CDATA[<p>I regularly use the saveXML() method, available on all node class-based objects, as a way to debug my forms (think of it as a type of introspection technique). The method outputs a string representation of the XML content of the node in question, which helps when attempting to discover the underlying object structure without a debugger&#8230;</p>
<p>For example, say you have a simple form with a text field and a numeric field. The following statement will output the form&#8217;s data to the JavaScript Console in Acrobat:</p>
<pre><code>console.println(xfa.datasets.data.saveXML());</code></pre>
<p>The result, however, isn&#8217;t very readable:</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xfa:data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
&gt;&lt;form1
&gt;&lt;TextField1
&gt;asdf&lt;/TextField1
&gt;&lt;NumericField1
&gt;1234&lt;/NumericField1
&gt;&lt;/form1
&gt;&lt;/xfa:data
&gt;</code></pre>
<p>Though I had been using saveXML() for quite some time, I hadn&#8217;t realized that it actually takes an optional parameter, a string with a value of &#8220;pretty&#8221;, that results in much nicer output.</p>
<pre><code>console.println(xfa.datasets.data.saveXML('pretty'));</code></pre>
<p>results in the following pretty/readable output:</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xfa:data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"&gt;
&nbsp;&nbsp;&nbsp;&lt;form1&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TextField1&gt;asdf&lt;/TextField1&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;NumericField1&gt;1234&lt;/NumericField1&gt;
&nbsp;&nbsp;&nbsp;&lt;/form1&gt;
&lt;/xfa:data&gt;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://forms.stefcameron.com/2009/08/19/tip-pretty-xml-strings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FormFeed Debugging Tips</title>
		<link>http://forms.stefcameron.com/2009/05/27/formfeed-debugging-tips/</link>
		<comments>http://forms.stefcameron.com/2009/05/27/formfeed-debugging-tips/#comments</comments>
		<pubDate>Wed, 27 May 2009 20:28:34 +0000</pubDate>
		<dc:creator>Stefan Cameron</dc:creator>
				<category><![CDATA[Acrobat]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Designer]]></category>
		<category><![CDATA[Form Guides]]></category>
		<category><![CDATA[Script Editor]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://forms.stefcameron.com/2009/05/27/formfeed-debugging-tips/</guid>
		<description><![CDATA[My friend John Brinkman has posted a really good list of handy form development and debugging tips. Check it out! These tips could save you a lot of time and effort. I use them all the time when I work on forms with Designer, Acrobat and LiveCycle Forms. One other nice thing about console.println() for [...]]]></description>
			<content:encoded><![CDATA[<p>My friend John Brinkman has posted a <a href="http://blogs.adobe.com/formfeed/2009/05/collected_form_development_and.html">really good list</a> of handy form development and debugging tips. Check it out! These tips could save you <em>a lot</em> of time and effort. I use them all the time when I work on forms with Designer, Acrobat and LiveCycle Forms.</p>
<p>One other nice thing about <a href="http://forms.stefcameron.com/2006/05/05/debugging-scripts/">console.println()</a> for outputting debug information to the JavaScript Console in Acrobat is that these strings are also output to the Flash Log when you run <a href="http://forms.stefcameron.com/category/form-guides/">form guides</a> generated with LiveCycle ES Update 1 (8.2.1) using the Flash Debug Player. (The <a href="http://forms.stefcameron.com/2008/11/19/max-2008-tutorial-part3/">3rd part</a> of my MAX 2008 Tutorial series has details on how to set this up under the &#8220;Flash Log and Debug Players&#8221; section.)</p>
]]></content:encoded>
			<wfw:commentRss>http://forms.stefcameron.com/2009/05/27/formfeed-debugging-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hidden JavaScript Exception Information</title>
		<link>http://forms.stefcameron.com/2009/03/13/hidden-javascript-exception-information/</link>
		<comments>http://forms.stefcameron.com/2009/03/13/hidden-javascript-exception-information/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 11:00:41 +0000</pubDate>
		<dc:creator>Stefan Cameron</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://forms.stefcameron.com/2009/03/13/hidden-javascript-exception-information/</guid>
		<description><![CDATA[In case you missed it, John Brinkman posted a great article on how to extract more information from a JavaScript exception (caught in a try/catch block). Have a look &#8212; there&#8217;s lots of useful information in the exception object and it&#8217;s just a matter of knowing how to expose it. It could save you hours [...]]]></description>
			<content:encoded><![CDATA[<p>In case you missed it, John Brinkman <a href="http://blogs.adobe.com/formfeed/2009/03/handling_javascript_exceptions.html">posted</a> a great article on how to extract more information from a JavaScript exception (caught in a try/catch block). Have a look &#8212; there&#8217;s lots of useful information in the exception object and it&#8217;s just a matter of knowing how to expose it. It could save you hours of debugging time!</p>
]]></content:encoded>
			<wfw:commentRss>http://forms.stefcameron.com/2009/03/13/hidden-javascript-exception-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Careful with Form Compatibility Settings</title>
		<link>http://forms.stefcameron.com/2009/02/11/careful-with-form-compatibility-settings/</link>
		<comments>http://forms.stefcameron.com/2009/02/11/careful-with-form-compatibility-settings/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 18:00:35 +0000</pubDate>
		<dc:creator>Stefan Cameron</dc:creator>
				<category><![CDATA[Acrobat]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Designer]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[XFA]]></category>

		<guid isPermaLink="false">http://forms.stefcameron.com/2009/02/11/careful-with-form-compatibility-settings/</guid>
		<description><![CDATA[Let me put it simply: I got burned by using a particular syntax to check the existence of a field inside a subform object due to form compatibility settings in LiveCycle Designer 8.2. What? It started with a form I had created using Designer 8.1 which was set to target Acrobat 8.1/XFA 2.6. Later-on, I [...]]]></description>
			<content:encoded><![CDATA[<p>Let me put it simply: I got <strong><font color="#eb6210">burned</font> </strong>by using a particular syntax to check the existence of a field inside a subform object due to form compatibility settings in LiveCycle Designer 8.2.</p>
<h2>What?</h2>
<p>It started with a form I had created using Designer 8.1 which was set to target Acrobat 8.1/XFA 2.6. Later-on, I installed Designer 8.2 and wanted to update my form to target Acrobat 9/XFA 2.8.</p>
<p>In my form, I had a script object with various functions that used the following syntax to test the existence of a field inside a subform object which was passed-in to these functions as a parameter:</p>
<pre><code>if (subformObj.someField)</code></pre>
<p>The result of this was what I expected: If &#8216;someField&#8217; existed inside &#8216;subformObj&#8217;, the IF statement would evaluate to &#8216;true&#8217;; if it didn&#8217;t, it would evaluate to &#8216;false&#8217;. According to the rules of dynamic properties in JavaScript, this was all fine and dandy.</p>
<p><span id="more-306"></span>
<p>All my scripts were set to run on <em>client only</em>. Then I found myself having to execute them on the server. So I set all my scripts, including my script object, to <em>Run At &#8216;Client and Server&#8217;</em> using the Script Editor. That&#8217;s when the problems first started showing-up. The server log showed the following <strong>error messages</strong> whenever the JavaScript engine would come across the above IF statements in cases where, after a little investigating, I determined &#8216;someField&#8217; was <em>not</em> inside &#8216;subformObj&#8217;:</p>
<pre><code>GeneralError: Operation failed.
XFAObject.someField:2935:XFA:form1[0]:bodyPage[0]:subformObj[0]:otherField[0]:initialize
Invalid property get operation; subform doesn't have property 'someField'</code></pre>
<p>But why was I getting these error messages? My form was executing just fine in those circumstances on the client (in Acrobat and Reader 9) and I even had &quot;Form Properties &gt; Defaults &gt; <em>Enforce Strict Scoping Rules in JavaScript</em>&quot; enabled in my form.</p>
<h2>Why?</h2>
<p>Well it turns-out that while my form was now <em>targetting </em>Acrobat 9/XFA 2.8 (since my &lt;template&gt; node&#8217;s namespace, in the XML Source view, was properly set to &quot;http://www.xfa.org/schema/xfa-template/2.8/&quot;), it was still <em>behaving</em> like an <em>XFA 2.6</em> form! That meant that my scripts were subject to the same rules as scripts running in Acrobat 8.1, not Acrobat 9.</p>
<p>Back in Acrobat 8.1/XFA 2.6, the client-side XFAObject form objects in JavaScript supported the addition of custom/dynamic properties yet the server-side (LiveCycle; xfa.host.name == &quot;XFAPresentationAgent&quot;) ones did not. Hence the error messages like the one above.</p>
<p>How did this happen? Well, when I opened my old Designer 8.1 form in Designer 8.2 and updated its target to Acrobat/Reader 9 and XFA 2.8, Designer did what it does by default which is insert the following processing instruction in the form in order to give the form access to the new XFA 2.8 APIs yet make it still <em>behave</em> like an XFA 2.6 form in order to <strong>maintain compatibility</strong>:</p>
<pre><code>&lt;?originalXFAVersion http://www.xfa.org/schema/xfa-template/2.6/?&gt;</code></pre>
<p>Unfortunately, that&#8217;s not what <em>I</em> wanted. My intention, when updating the form&#8217;s target version, was to make that form Acrobat 9 + XFA 2.8 compliant &#8212; even if it meant I had to potentially deal with some behavioral differences &#8212; in order to take full advantage of all the new features <em>and bug fixes</em>.</p>
<p>Once I removed the offending processing instruction (by going to the XML Source view in Designer and removing it manually since there&#8217;s no UI to do this), Acrobat and Reader 9 began to throw the same exceptions as the server which was good because it meant I was finally in the situation I had wanted all along: XFA 2.8 compatibility <em>and</em> behavior!</p>
<p>Thankfully, fixing my script wasn&#8217;t too difficult. The new version,</p>
<pre><code>if (subformObj.resolveNode(&quot;someField&quot;))</code></pre>
<p>works very predictably for both client- and server-side rendering and what&#8217;s more, the custom/dynamic properties I do create on regular JavaScript Object variables are <strong>safe from garbage collection</strong>.</p>
<h2>Recommendations</h2>
<p>If you want to understand more about form target and compatibility settings along with the do&#8217;s and don&#8217;ts of custom properties in JavaScript within XFA forms, I <strong>highly recommend</strong> you read John Brinkman&#8217;s posts on the <a href="http://blogs.adobe.com/formfeed/2009/02/scope_of_javascript_objects.html">scope of JavaScript objects</a> and <a href="http://blogs.adobe.com/formfeed/2009/02/form_compatibility.html">form compatibility settings</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://forms.stefcameron.com/2009/02/11/careful-with-form-compatibility-settings/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MAX 2008 Tutorial &#8211; Part 3 &#8211; Form Guide</title>
		<link>http://forms.stefcameron.com/2008/11/19/max-2008-tutorial-part3/</link>
		<comments>http://forms.stefcameron.com/2008/11/19/max-2008-tutorial-part3/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 13:00:53 +0000</pubDate>
		<dc:creator>Stefan Cameron</dc:creator>
				<category><![CDATA[Acrobat]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Form Guides]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Tables]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://forms.stefcameron.com/2008/11/19/max-2008-tutorial-part-3-form-guide/</guid>
		<description><![CDATA[Welcome to the third and final part of a three-part post series tutorial on importing data into a form guide and a PDF. The first part covered the form design, the second part covered the Flex code and the third part will cover designing and debugging the form guide that will complete the solution. Form [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to the third and final part of a three-part post series tutorial on importing data into a form guide and a PDF. The <a href="http://forms.stefcameron.com/2008/11/17/max-2008-tutorial-part1/">first part</a> covered the form design, the <a href="http://forms.stefcameron.com/2008/11/18/max-2008-tutorial-part2/">second part</a> covered the Flex code and the third part will cover designing and debugging the form guide that will complete the solution.</p>
<h2>Form Guide Layout</h2>
<p>The goal is to design a form guide which will provide two panels: one for user options and the other for results.</p>
<p>The first panel will expose the 4 fields inside the GuideObjects subform (which are only meant to be exposed in the form guide &#8212; hence why the GuideObjects subform has the Initialize script to hide it if the host isn&#8217;t &#8220;Flash&#8221;). The user will have the option to choose an actor and/or category for further filtering and will then click on the GetMovies button to execute the request on the <a href="http://forms.stefcameron.com/services/movies/?help=1">Movie Service</a>. When the requested XML is returned to the form guide, the GetMovies result handler will convert the XML into instances of MovieRow inside the Listing table.</p>
<p>The second panel will use a <strong>repeater layout</strong> to expose the Listing table&#8217;s contents within the form guide however this panel will only be accessible if the movie query returned 1 or more results.</p>
<p>Once the results are in, the user will then be able to switch (&#8220;flip&#8221;) to the PDF view which will show the Listing table in the form, from which the user could then print or archive the results.</p>
<p><span id="more-264"></span><br />
<h2>Designing the Form Guide</h2>
<p>Open your tutorial form in Designer and launch GuideBuilder (GB) by choosing the &#8220;Tools &gt; Create or Edit Form Guide&#8221; command. Switch to the &#8220;Customize Appearance&#8221; tab and choose &#8220;Save Styles&#8221;, saving them to a SWC file of your choice (usually in the same folder). It&#8217;s not mandatory to do this but if you don&#8217;t specify a file name here, GB will auto-generate a style SWC (which contains information about any style customizations you might apply) named according to the wrapper you choose (e.g. &#8220;ga.wrappers.CobaltStandard.swc&#8221; for the &#8220;Cobalt Standard&#8221; wrapper &#8212; not the most meaningful name for our solution).</p>
<p>Back to the &#8220;Edit Guide&#8221; tab, set the guide&#8217;s title to &#8220;MAX 2008 Movie Catalog Service&#8221; (double-click on the &#8220;New Guide&#8221; label to set it), the section&#8217;s title to &#8220;Movie Catalog&#8221; and the panel&#8217;s title to &#8220;Options&#8221;. Set the panel&#8217;s layout to &#8220;Two Column&#8221;.</p>
<p><img src="http://forms.stefcameron.com/images/Max2008/Max2008Tutorial-Part3-1.Png"></p>
<h3>Options Panel</h3>
<p>Click on the &#8220;Add or Bind Fields&#8221; button and drag the entire GuideObjects subform into the panel. You&#8217;ll see, in the &#8220;Panel Preview&#8221; pane on the lower-right, that objects in the panel are laid-out in two columns from left to right, top to bottom, according to the top-down order in which they appear in the panel. What we want is for the MatchCount field to show-up <em>below</em> the GetMovies button. To do this, insert a &#8220;Next Area&#8221; object (from the &#8220;Utility Objects&#8221; group at the top of the form tree) after all the objects in the panel and then drag the MatchCount field below it. The &#8220;Next Area&#8221; object causes a break in the layout algorithm, thereby forcing the following object onto the next row in the two-column layout.</p>
<p>To make the panel layout more pleasing, switch back to the &#8220;Set Properties&#8221; view and set the captions of the ActorList, CategoryList and MatchCount fields to be at the top and the width of both listboxes to be &#8220;100%&#8221;. Finally, override the MatchCount field&#8217;s caption (double-click on it) and set it to &#8220;Number of movies matching criteria:&#8221; (accept the warning about the caption binding being removed).</p>
<blockquote><p>One important form guide feature is the ability to display fields in different ways. In other words, if your field is a listbox, for example, you aren&#8217;t limited to displaying it as a traditional listbox. You could choose to display it as a series of checkboxes or radio buttons, for example, or you could create your own custom control using FlexBuilder.</p></blockquote>
<p>GB provides a checkbox control type which will suit our needs perfectly because while our listboxes are single-selection only, using checkboxes will allow the user to remove a previous selection which is important if they previously filtered by actor, for instance, and now they want to remove that filter.</p>
<p>For the ActorList and CategoryList fields, set their &#8220;Display field as a&#8221; property to &#8220;Check Boxes&#8221;.</p>
<p>At this point, the settings for the ActorList (and CategoryList) fields should look like this:</p>
<p><img src="http://forms.stefcameron.com/images/Max2008/Max2008Tutorial-Part3-2.Png"></p>
<p>and your form guide hierarchy should look like this:</p>
<p><img src="http://forms.stefcameron.com/images/Max2008/Max2008Tutorial-Part3-3.Png"></p>
<h3>Movie Listings Panel</h3>
<p>The second panel is a lot simpler since it just shows the Listing table&#8217;s contents and it doesn&#8217;t require as much settings.</p>
<p>Insert a second panel into the &#8220;Movie Catalog&#8221; section, give it a title of &#8220;Movie Listings&#8221; and set its layout to be &#8220;Repeater Grid&#8221;.</p>
<p><img src="http://forms.stefcameron.com/images/Max2008/Max2008Tutorial-Part3-4.Png"></p>
<p>The objects named &#8220;Repeater First Column&#8221; and &#8220;Repeater Second Column&#8221; don&#8217;t apply to this type of repeater panel however they do matter in other repeater layouts and are there for consistency (should you decide to change the repeater panel type). The &#8220;Trailer&#8221; object signifies that all objects placed after it, on this panel, will go <em>below</em> the grid as opposed to being part of the grid (this would be good for footer objects, if we had any).</p>
<p>Drag the MovieRow subform (table row) into the panel <strong>between</strong> the &#8220;Repeater First Column&#8221; and &#8220;Repeater Second Column&#8221; objects (drop the subform directly in between the two objects &#8212; if you miss, just drag each object back to where it&#8217;s supposed to go).</p>
<p>For each field you dragged-in, set its caption as follows: &#8220;Title&#8221;, &#8220;Actor&#8221;, &#8220;Category&#8221; and &#8220;Cost&#8221;. (You should see these changes in real-time in the Panel Preview pane.) Select the Title item and set its width to 150 (which means pixels in the form guide) to ensure the titles are completely visible and then set its &#8220;<strong>Allow field to repeat</strong>&#8221; property to indicate that it, and all associated fields, should be repeated within the grid layout. The items in the panel will then get a yellow outline indicating that they are repeating items.</p>
<p><img src="http://forms.stefcameron.com/images/Max2008/Max2008Tutorial-Part3-5.Png"></p>
<p>Now that we&#8217;ve set this up, I&#8217;ll follow-up on a comment I made in part 1 when we designed the Listing table and set the MovieRow to have 1 initial instance: There&#8217;s a <strong>bug in the Repeater Grid </strong>panel layout where the data entered into the fields in the grid will not be rendered (it&#8217;s there, you just can&#8217;t see it) unless there&#8217;s some data in the grid when the form guide is initialized. To work around the bug, we simply include an initial instance of the MovieRow and then the GetMovies result handler code simply removes the instance prior to populating the table with movie results (whether there are any or not).</p>
<p>The last step in setting-up this panel is to apply a <strong>Display Rule</strong> to indicate when the panel should be visible (accessible to the user) in the form guide. What we want to do is set the panel to be visible only if the MatchCount field&#8217;s value is greater than zero, meaning there&#8217;s at least one movie result from the query. To do this, you simply toggle the &#8220;Specify panel display rules&#8221; pane in the panel&#8217;s properties, choose &#8220;Use Display Rules&#8221;, add a rule, set MatchCount as the field, &#8220;greater than&#8221; as the condition and &#8220;0&#8243; as the value.</p>
<p><img src="http://forms.stefcameron.com/images/Max2008/Max2008Tutorial-Part3-6.Png"></p>
<h2>FormBridge XFO Fix</h2>
<p>Now that the form guide has been designed, the<br />
re&#8217;s just one more thing we need to do: Apply a small fix to the FormBridge code that brokers the communication between the form guide and the PDF at runtime. The FormBridge code is normally automatically injected into the PDF when it&#8217;s generated by the GB Preview functionality or by LiveCycle when the form is rendered as a form guide with the PDF however we need to use our own &#8220;fixed&#8221; version of the FormBridge code. Otherwise, when we flip to the PDF, <strong>there will be no data in the table.</strong></p>
<p>To do this, save your changes to the form guide and exit GB. Find the &#8220;Custom&#8221; pane in Designer&#8217;s Object Library and drag the &#8220;Form Bridge&#8221; object onto your form <strong>below</strong> the GuideObjects subform (where there are no objects on the page).</p>
<p><img src="http://forms.stefcameron.com/images/Max2008/Max2008Tutorial-Part3-7.Png"></p>
<p>It shows-up as a hairline selection on the page and in the hierarchy looks like this:</p>
<p><img src="http://forms.stefcameron.com/images/Max2008/Max2008Tutorial-Part3-8.Png"></p>
<p>Select the &#8220;ContainerFoundation_JS&#8221; script object and open the Script Editor to edit the script. Find the two instances of &#8220;saveXML()&#8221; (lines 316 and 631) using the Find dialog (Ctrl + F) and change them from</p>
<pre><code>saveXML().replace(/\n/g, "");</code></pre>
<p>to</p>
<pre><code>saveXML();</code></pre>
<p>Do not remove/change any of the code that comes before it on the same line. This fix ensures that the format of the data going across the line is correct.</p>
<p>With the FormBridge object in our form, GB Preview and LiveCycle will not inject their version into the PDF. The only draw-back from this approach is that if the FormBridge code changes, you&#8217;ll have to manually update it in your form as opposed to automatically getting the new version when you preview with GB or render your form with LiveCycle.</p>
<p>This bug should be fixed in a future release and so the workaround in the FormBridge code will eventually no longer be needed.</p>
<h2>Flash Log and Debug Players (Optional)</h2>
<p>You may have noticed some &#8220;trace()&#8221; statements in the code we set on the ActorList, CategoryList and GetMovies objects in part 2. This is a handy way to get a read on what&#8217;s going on (i.e. debugging) inside the form guide at runtime if you aren&#8217;t using FlexBuilder to debug it (which we&#8217;re trying to avoid in this tutorial). It&#8217;s a lot like using &#8220;console.println()&#8221; to output information to Acrobat&#8217;s JavaScript Console.</p>
<p>If you want to see trace statement outputs (it&#8217;s not necessary but it could be handy), you need to look at your flashlog.txt file which is auto-generated by the <strong>debug</strong> version of the Flash Player. These are normally called &#8220;debug players&#8221; or &#8220;content debuggers&#8221; and are <a href="http://www.adobe.com/support/flashplayer/downloads.html">downloadable here</a>. To ensure that you have a debug player, you can hit <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19245&amp;sliceId=1">this page</a> which will tell you what version and type of Flash Player your browser is using.</p>
<p>Once you&#8217;ve installed a debug player, you&#8217;ll need to configure your system to enable the flashlog.txt file which will be located here, once enabled: C:\Documents and Settings\<em>user_name</em>\Application Data\Macromedia\Flash Player\Logs\flashlog.txt (XP) or C:\Users\<em>user_name</em>\AppData\Roaming\Macromedia\Flash Player\Logs\flashlog.txt (Vista).</p>
<p>The <a href="http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&amp;file=logging_125_04.html">debugger configuration page</a> details where to place the mm.cfg file and what to put in it in order to enable output to the flashlog.txt file. For example, if you&#8217;re running XP, you would create a new mm.cfg file in your &#8220;C:\Documents and Settings\<em>user_name</em>\&#8221; folder and you would put the following lines inside to enable error reporting and trace logging (i.e. output to the flashlog.txt file):</p>
<pre><code>TraceOutputFileEnable=1
ErrorReportingEnable=1</code></pre>
<h2>Running the Solution</h2>
<p>Now that the form guide is designed, we&#8217;re ready to run our solution: Launch GB again and this time, choose the Preview tab, select &#8220;Include PDF Preview&#8221; (to ensure that a PDF is included, otherwise you won&#8217;t be able to flip to it to see the results) and click on the Preview button.</p>
<p><img src="http://forms.stefcameron.com/images/Max2008/Max2008Tutorial-Part3-9.Png"></p>
<p>The resulting form guide should look like this (with the pre-loaded actor and category lists):</p>
<p><img src="http://forms.stefcameron.com/images/Max2008/Max2008Tutorial-Part3-10.Png"></p>
<p>When you click on the &#8220;Get Movies&#8221; button, the button will become temporarily disabled and then, assuming your query returned movies, the count should be updated and the &#8220;Movie Listing&#8221; panel should appear in the left toggle bar:</p>
<p><img src="http://forms.stefcameron.com/images/Max2008/Max2008Tutorial-Part3-11.Png"></p>
<p>Now click on the &#8220;Movie Listing&#8221; panel to see the results in the form guide:</p>
<p><img src="http://forms.stefcameron.com/images/Max2008/Max2008Tutorial-Part3-12.Png"></p>
<p>Finally, click on the &#8220;Show PDF&#8221; icon in the toolbar at the top-right to see the results (i.e. imported Movie Service data) in the PDF:</p>
<p><img src="http://forms.stefcameron.com/images/Max2008/Max2008Tutorial-Part3-13.Png"></p>
<p>Cool? I think so! And the cherry on top is that this even works with the free Reader! Users don&#8217;t need Acrobat in order for the data to go back and forth between the form guide and the PDF.</p>
<h2>Solution to Part 3</h2>
<p>Try not to peek at this before you attempt to build the form guide on your own…</p>
<p><a href="http://forms.stefcameron.com/samples/max2008/Max2008-MovieCatalog-Part3.zip">Download Part 3 [zip]</a></p>
<p><strong>Minimum Requirements:</strong> Designer 8.2.1 SP1, GuideBuilder 8.2.1 SP1, Reader 9.0.</p>
<p><strong>Note:</strong> If you decide to deploy this sample to LiveCycle (e.g. using FormsIVS), you&#8217;ll also need to deploy the styles SWC you created earlier. The form guide will not render without it.</p>
]]></content:encoded>
			<wfw:commentRss>http://forms.stefcameron.com/2008/11/19/max-2008-tutorial-part3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Target Version Reference</title>
		<link>http://forms.stefcameron.com/2008/04/18/target-version-reference/</link>
		<comments>http://forms.stefcameron.com/2008/04/18/target-version-reference/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 14:59:43 +0000</pubDate>
		<dc:creator>Stefan Cameron</dc:creator>
				<category><![CDATA[Acrobat]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Designer]]></category>

		<guid isPermaLink="false">http://forms.stefcameron.com/?p=145</guid>
		<description><![CDATA[LC Designer ES (8.1) introduced a new feature called Target Version to help you design forms for use in specific versions of Acrobat/Reader. Although new releases of Designer usually support most new features introduced in new releases of Acrobat, there are still some differences and the Target Version feature will help you ensure that your [...]]]></description>
			<content:encoded><![CDATA[<p>LC Designer ES (8.1) introduced a new feature called <i>Target Version</i> to help you design forms for use in specific versions of Acrobat/Reader. Although new releases of Designer usually support most new features introduced in new releases of Acrobat, there are still some differences and the Target Version feature will help you ensure that your form isn&#8217;t using a feature that isn&#8217;t compatible with the version of Acrobat/Reader that you&#8217;re targeting (the version you expect the users of your form to use).</p>
<p>You can set a form&#8217;s target version by using the &#8220;File menu > Form Properties > Defaults > Target Version&#8221; property.</p>
<p>For example, the &#8220;Lock Fields After Signing&#8221; feature of digital signature fields is not supported in versions of Acrobat/Reader less than 8.0. By setting your form&#8217;s target version to &#8220;Acrobat/Reader 7.0.5 or later&#8221;, Designer would issue a warning (in the Warnings palette) about this fact if you placed a digital signature field on your form and checked the &#8220;Object palette > Document Signature > Lock Fields after Signing&#8221; box.</p>
<p>The <a href="http://www.adobe.com/support/documentation/en/livecycle/">Target Version Reference</a> document (under the &#8220;Develop&#8221; tab) details the versions of Acrobat/Reader that are compatible with <b>Designer features</b> from version 6.0 to 8.1, incl. This should help you ensure that your forms are always compatible with the versions of Acrobat/Reader you expect your target audience to use.</p>
]]></content:encoded>
			<wfw:commentRss>http://forms.stefcameron.com/2008/04/18/target-version-reference/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Adobe Unveils LiveCycle ES</title>
		<link>http://forms.stefcameron.com/2007/06/04/adobe-unveils-livecycle-es/</link>
		<comments>http://forms.stefcameron.com/2007/06/04/adobe-unveils-livecycle-es/#comments</comments>
		<pubDate>Mon, 04 Jun 2007 17:29:51 +0000</pubDate>
		<dc:creator>Stefan Cameron</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Designer]]></category>
		<category><![CDATA[FormCalc]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://forms.stefcameron.com/2007/06/04/adobe-unveils-livecycle-es/</guid>
		<description><![CDATA[Today, Adobe unveiled its new LiveCycle Enterprise Suite. It includes a whole slew of new product versions all designed to work together in an IDE (Integrated Development Environment), bringing PDF and Flash together in the same workflow using a new technology called Form Guides (see the Generate dynamic Adobe Flash&#174; Player compatible form guides topic [...]]]></description>
			<content:encoded><![CDATA[<p>Today, <a href="http://www.adobe.com">Adobe</a> unveiled its new <a href="http://www.adobe.com/products/livecycle/">LiveCycle Enterprise Suite</a>. It includes a whole slew of new product versions all designed to work together in an IDE (Integrated Development Environment), bringing PDF and Flash together in the same workflow using a new technology called <strong>Form Guides</strong> (see the <a href="http://www.adobe.com/products/livecycle/forms/features.html">Generate dynamic Adobe Flash&reg; Player compatible form guides</a> topic in the <a href="http://www.adobe.com/products/livecycle/forms/">LC Forms ES</a> feature list). Form Guides enable you to add an RIA (Rich Internet Application) view to your  form to engage your customers in a more compelling way.</p>
<p>What&#8217;s more is that the new Enterprise Suite launch means that there&#8217;s also <strong>new version of Designer</strong>: <a href="http://www.adobe.com/products/livecycle/designer/">LiveCycle Designer ES</a> (version 8.1). I <em>believe</em> this will be an upgrade to Designer 8.0 which currently ships with <a href="http://www.adobe.com/products/acrobatpro/">Acrobat Pro</a> 8.0. Most notable in this new version are</p>
<ul>
<li>the new <strong>Guide Builder tool </strong>which will help you quickly re-purpose your PDF form as a <strong>Flash-based</strong> <strong>Form Guide</strong>;</li>
<li>a new feature called <strong>Form Fragments</strong> which will enable you to <strong>re-use sections of your forms and scripts </strong>in other forms while only needing to <strong>make changes in one place</strong>;</li>
<li>a <strong>Syntax Checker</strong> in the Script Editor to check for errors in your scripts (this will definitely help with debugging!); and</li>
<li>the <strong>Target Validation</strong> feature which will help you determine which XFA features you may use when targeting a specific version of Reader/Acrobat (e.g. if you specify Reader/Acrobat 7.0 as your <em>target version</em> and you insert a table into your form, you&#8217;ll get a warning telling you that tables aren&#8217;t supported in Reader/Acrobat 7.0 &#8212; they&#8217;re only supported as of Reader/Acrobat 7.0.5).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://forms.stefcameron.com/2007/06/04/adobe-unveils-livecycle-es/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Previewing as Dynamic PDF</title>
		<link>http://forms.stefcameron.com/2006/07/24/previewing-as-dynamic-pdf/</link>
		<comments>http://forms.stefcameron.com/2006/07/24/previewing-as-dynamic-pdf/#comments</comments>
		<pubDate>Mon, 24 Jul 2006 18:40:25 +0000</pubDate>
		<dc:creator>Stefan Cameron</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Designer]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://forms.stefcameron.com/blog/?p=27</guid>
		<description><![CDATA[Have you ever lived through the frustration of previewing a form on which you&#8217;ve written a simple little script to affect the presence of an object when a button is clicked and pulling your hair out because you keep clicking on the button and nothing happens (object doesn&#8217;t disappear, there&#8217;s no error message, etc.)? Or [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever lived through the frustration of previewing a form on which you&#8217;ve written a simple little script to affect the presence of an object when a button is clicked and pulling your hair out because you keep clicking on the button and nothing happens (object doesn&#8217;t disappear, there&#8217;s no error message, etc.)? Or maybe you&#8217;ve been in a situation where you&#8217;ve added script to a button in order to <a href="http://forms.stefcameron.com/category/instance-manager/">insert a new instance of a repeatable subform</a> and while clicking on the button doesn&#8217;t produce one, the submitted <span class="caps">XML </span>data file contains entries for each new instance that was added?</p>
<p>Even if you haven&#8217;t, it may happen someday so here&#8217;s the remedy for the case of the &#8220;Common (Static <span class="caps">PDF</span>) Flue&#8221;&#8230;</p>
<p>In Designer, there are two different locations containing settings which affect the type of temporary <span class="caps">PDF </span>file created when you click on the Preview tab:</p>
<ol>
<li>Under the &#8220;File Options&#8221; section within the &#8220;Document Handling&#8221; panel of the &#8220;Tools | Options&#8221; dialog, you can set the <em>Default File Type for New Forms</em>. This type is used on new forms which you preview <strong>prior</strong> to saving (because Designer doesn&#8217;t know which format you&#8217;ll use at the time of preview). This is set to a static <span class="caps">PDF </span>format by default.</li>
<li>Even if you&#8217;ve specified a dynamic <span class="caps">PDF </span>format for the <em>Default File Type for New Forms</em>, this setting may be overridden by the <em>Preview Type</em> and <em><span class="caps">XDP</span> Preview Format</em> properties in the &#8220;File | Form Properties&#8221; dialog in the &#8220;Defaults&#8221; panel once you&#8217;ve saved your form. The <em>Preview Type</em> property, set to &#8220;Interactive&#8221; by default, determines whether the form will be previewed as an interactive (dynamic) form or as a print (static) form. This property supersedes the <span class="caps">PDF </span>format. The <em><span class="caps">XDP</span> Preview Format</em> property usually picks-up the <em>Default File Type for New Forms</em> setting and determines what <span class="caps">PDF </span>format will be used to preview your form should it be saved as an <span class="caps">XDP. </span>(Note that if you&#8217;ve saved your form as a <span class="caps">PDF </span>file, then the <em><span class="caps">XDP</span> Preview Format</em> setting is ignored).</li>
</ol>
<p>Now that we&#8217;ve covered the different properties which affect the <span class="caps">PDF </span>preview format, here&#8217;s how to kick that flue I was talking about earlier (so that you actually do preview in a dynamic <span class="caps">PDF </span>format and stop pulling your hair out):</p>
<ol>
<li>If you haven&#8217;t saved your form, make sure the <em>Preview Type</em> is set to &#8220;Interactive&#8221; and that the <em>Default File Type for New Forms</em> is set to a dynamic <span class="caps">PDF </span>format. You may also want to set the <em><span class="caps">XDP</span> Preview Format</em> to a dynamic <span class="caps">PDF </span>format while you&#8217;re at it.</li>
<li>If you&#8217;ve saved your form as a <em>dynamic</em> <span class="caps">PDF, </span>make sure the <em>Preview Type</em> is set to &#8220;Interactive&#8221;.</li>
<li>If you&#8217;ve saved your form as a <em>static</em> <span class="caps">PDF, </span>none of these settings will help you. You must first save your form as a dynamic <span class="caps">PDF.</span></li>
<li>If you&#8217;ve saved your form as an <span class="caps">XDP, </span>make sure the <em>Preview Type</em> is set to &#8220;Interactive&#8221; and the <em><span class="caps">XDP</span> Preview Format</em> is set to a dynamic <span class="caps">PDF </span>format.</li>
<li>If you&#8217;re tired of running into these problems and want to avoid them in the future, just set your <em>Default File Type for New Forms</em> to a dynamic <span class="caps">PDF </span>format.</li>
</ol>
<p>I hope this tip improves your form design health. It did wonders for me!</p>
<p><sub class="postUpdate"><strong>Updated:</strong> January 27, 2007</sub></p>
]]></content:encoded>
			<wfw:commentRss>http://forms.stefcameron.com/2006/07/24/previewing-as-dynamic-pdf/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
	</channel>
</rss>

