<?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>Assure HSC &#124; Blog &#187; Samples</title>
	<atom:link href="http://assurehsc.ie/blog/index.php/category/livecycle/samples/feed" rel="self" type="application/rss+xml" />
	<link>http://assurehsc.ie/blog</link>
	<description>Technology and Safety</description>
	<lastBuildDate>Tue, 23 Nov 2010 20:34:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Referencing Objects</title>
		<link>http://assurehsc.ie/blog/index.php/2010/08/referencing-objects/</link>
		<comments>http://assurehsc.ie/blog/index.php/2010/08/referencing-objects/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 12:11:48 +0000</pubDate>
		<dc:creator>Niall O'Donovan</dc:creator>
				<category><![CDATA[LiveCycle]]></category>
		<category><![CDATA[Samples]]></category>
		<category><![CDATA[LC Designer]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[XFA Form]]></category>

		<guid isPermaLink="false">http://assurehsc.ie/blog/?p=317</guid>
		<description><![CDATA[When referencing objects in LiveCycle Designer ES2, you need to ensure that you are providing a sufficiently complete reference to the objects. If you do &#8211; the script will work; whereas if you don&#8217;t &#8211; the script may fail silently. A sample form is available here. Tip 1: name objects as you go! First off [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fassurehsc.ie%2Fblog%2Findex.php%2F2010%2F08%2Freferencing-objects%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fassurehsc.ie%2Fblog%2Findex.php%2F2010%2F08%2Freferencing-objects%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>When referencing objects in LiveCycle Designer ES2, you need to ensure that you are providing a sufficiently complete reference to the objects. If you do &#8211; the script will work; whereas if you don&#8217;t &#8211; the script may fail silently.</p>
<p><span id="more-317"></span></p>
<p><a title="Click here to open the sample in a new window..." href="http://assurehsc.ie/blog/wp-content/uploads/2010/08/2010-08-01-Referencing-Objects-A.pdf" target="_blank"><strong>A sample form is available here</strong></a>.</p>
<p><strong><span style="color: #003300;"><span style="text-decoration: underline;">Tip 1:</span> name objects as you go!</span></strong></p>
<p>First off you should name objects as you develop your form. This applies to pages, subforms and other objects like textFields and numericFields. When objects are named it makes it so much easier to reference them in script.  For example if we take an object (&#8220;myTextField&#8221;) which is inside a subform (&#8220;mySubform&#8221;), then referencing this object from outside the subform is straightforward:</p>
<blockquote><p><em>this.rawValue = mySubform.myTextField.rawValue;</em></p></blockquote>
<p>On the other hand if the subform is not named, it has to be resolved in the script first:</p>
<blockquote><p><em>this.rawValue = xfa.resolveNode(&#8220;#subform[1].myTextField&#8221;).rawValue;</em></p></blockquote>
<p>Both of the above scripts will work; however the second takes additional resources (xfa.resolveNode) and makes the script logic difficult to follow.</p>
<p><strong><span style="color: #003300;"><span style="text-decoration: underline;">Tip 2:</span> use Control+Click to insert references</span></strong></p>
<p>LC Designer ES2 has a very handy tool, where you can insert the right amount of the object&#8217;s reference that is needed in the script. When you are in the script editor, hover your mouse over the object that you want to reference in your script. When you press and hold the Control key, you will notice that the mouse changes to a &#8216;V&#8217;. Now when you click the object, LC Designer ES2 will insert the correct reference into the script.</p>
<p>This feature is extremely useful and you should get into the habit of using it. Two big benefits:</p>
<ul>
<li>Your object references will be correct.</li>
<li>You will be quicker scripting events.</li>
</ul>
<p><span style="text-decoration: underline;"><span style="color: #003300;"><strong>A demonstration</strong></span></span></p>
<p>The <a title="Click here to open the sample..." href="http://assurehsc.ie/blog/wp-content/uploads/2010/08/2010-08-01-Referencing-Objects.pdf" target="_blank"><strong>sample</strong></a> provides examples of how different objects are referenced, depending on the relative path in-between the objects.</p>
<p>On each pages there are three &#8216;lights&#8217; that are controlled by their respective on/off button. In addition each page has a toggle state button, that controls each of the on/off buttons.</p>
<p>The main difference between the four pages is the manner in which objects are wrapped in subforms.</p>
<p>Notice that on page 4, the subforms have the same name, which allows the forms developer to use a loop script.</p>
<p>The form is available <strong><a title="Click here to open the form..." href="http://assurehsc.ie/blog/wp-content/uploads/2010/08/2010-08-01-Referencing-Objects-A.pdf" target="_blank">here</a></strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://assurehsc.ie/blog/index.php/2010/08/referencing-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Laying out a form</title>
		<link>http://assurehsc.ie/blog/index.php/2010/06/laying-out-a-form/</link>
		<comments>http://assurehsc.ie/blog/index.php/2010/06/laying-out-a-form/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 17:29:02 +0000</pubDate>
		<dc:creator>Niall O'Donovan</dc:creator>
				<category><![CDATA[LiveCycle]]></category>
		<category><![CDATA[Samples]]></category>
		<category><![CDATA[LC Designer]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[XFA Form]]></category>

		<guid isPermaLink="false">http://assurehsc.ie/blog/?p=170</guid>
		<description><![CDATA[As a forms developer, there are many options available to you when laying out your form. This post is not intended as a detailed explanation of forms design, merely a technical description of the specific options in LiveCycle Designer ES2 when using objects. To keep users happy, you should consider the layout of your form. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fassurehsc.ie%2Fblog%2Findex.php%2F2010%2F06%2Flaying-out-a-form%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fassurehsc.ie%2Fblog%2Findex.php%2F2010%2F06%2Flaying-out-a-form%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>As a forms developer, there are many options available to you when laying out your form. This post is not intended as a detailed explanation of forms design, merely a technical description of the specific options in LiveCycle Designer ES2 when using objects. <span id="more-170"></span></p>
<p>To keep users happy, you should consider the layout of your form. It is easy to pull objects into the form; however the manner in which you layout these objects and set the captions can affect the quality of the information that the user sends back to you.</p>
<p>Here is a <a title="Click here to open the sample..." href="http://assurehsc.ie/blog/wp-content/uploads/2010/11/2010-06-13-Some-options-for-laying-out-text-objects.pdf" target="_blank"><strong>sample form</strong></a>.</p>
<p>You can view the form in Acrobat/Reader. If you want to examine the script you will need to open the sample in LiveCycle Designer.</p>
<p>This sample demonstrate several options that are available to you. When you view the sample in Acrobat, the various options will appear to be quite similar. However the implementation in LiveCycle Designer is different for each one. The sample is a collection of objects, each one attempting to gather information about the user.</p>
<p>The usability of your form can be affected by a number of factors, including:</p>
<ul>
<li>font type and size.</li>
<li>font weight and colour.</li>
<li>paragraph alignment for the caption and value.</li>
<li>spacing of objects and relative alignment.</li>
</ul>
<p>Designing a form with a clear and crisp layout, will help the user complete the form.</p>
<p>Most objects in LiveCycle Designer come with a caption by default. The best solution is to use this caption, as it simplifies the layout process and form will render quicker.</p>
<p>When it comes to designing the form, we would recommend <em>Forms that Work &#8211; Designing web forms for usability</em>, by Caroline Jarrett and Gerry Gaffney. This is an excellent book that balances the technical aspects of LC Designer. You can get further information <a title="Click here for info..." href="http://formsthatwork.com/" target="_blank"><strong>here</strong></a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://assurehsc.ie/blog/index.php/2010/06/laying-out-a-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Picture puzzle</title>
		<link>http://assurehsc.ie/blog/index.php/2010/06/picture-puzzle/</link>
		<comments>http://assurehsc.ie/blog/index.php/2010/06/picture-puzzle/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 00:15:59 +0000</pubDate>
		<dc:creator>Niall O'Donovan</dc:creator>
				<category><![CDATA[LiveCycle]]></category>
		<category><![CDATA[Samples]]></category>
		<category><![CDATA[LC Designer]]></category>
		<category><![CDATA[XFA Form]]></category>

		<guid isPermaLink="false">http://assurehsc.ie/blog/?p=112</guid>
		<description><![CDATA[This form demonstrates a few tricks albeit in a irreverent way. Firstly using an &#8216;Adobe&#8217; grey as a background allows your form to be part of the application, rather than sitting on top it. The second uses script to allow the use to select a part of the puzzle and move it into the correct [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fassurehsc.ie%2Fblog%2Findex.php%2F2010%2F06%2Fpicture-puzzle%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fassurehsc.ie%2Fblog%2Findex.php%2F2010%2F06%2Fpicture-puzzle%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>This form demonstrates a few tricks albeit in a irreverent way. Firstly using an &#8216;Adobe&#8217; grey as a background allows your form to be part of the application, rather than sitting on top it. The second uses script to allow the use to select a part of the puzzle and move it into the correct position. <span id="more-112"></span></p>
<p>This won&#8217;t be winning any prizes in the games market, however it is not intended to be a serious puzzle. It just demonstrates some of the dynamic features of LiveCycle Designer ES2.</p>
<p>When you open the form, the puzzle elements are spread across the page. The challenge is to get the pieces into the correct position, in order to see the hidden screen.</p>
<p><a href="http://assurehsc.ie/blog/wp-content/uploads/2010/06/puzzle1.png"><img class="alignnone size-large wp-image-115" title="Start of the puzzle" src="http://assurehsc.ie/blog/wp-content/uploads/2010/06/puzzle1-1024x730.png" alt="start of the puzzle" width="614" height="438" /></a></p>
<p>Because Adobe changed the application grey from 103,103,103 in Acrobat 8 to 51,51,51 in Acrobat 9 (RGB), we need a script in the initialise event in order to affect the colour of the rectangle on the master page:</p>
<p><em>if (app.viewerVersion &gt;= 9)</em></p>
<p><em>{</em></p>
<p><em>background.value.rectangle.fill.color.value = &#8220;51,51,51&#8243;;</em></p>
<p><em>}</em></p>
<p><em>else</em></p>
<p><em>{</em></p>
<p><em>background.value.rectangle.fill.color.value = &#8220;103,103,103&#8243;;</em></p>
<p><em>}</em></p>
<p><em>this.access = &#8220;readOnly&#8221;;</em></p>
<p>The pieces are regular buttons with an image behind the button. The script that allows the user to move the pieces on clicking is a bit involved, but in essence monitors the x,y coordinates of the mouse on the click event.</p>
<p>Here is the final image you are striving for:</p>
<p><a rel="attachment wp-att-119" href="http://assurehsc.ie/blog/index.php/2010/06/picture-puzzle/puzzle3/"><img class="alignnone size-full wp-image-119" title="Completed puzzle" src="http://assurehsc.ie/blog/wp-content/uploads/2010/06/Puzzle3.png" alt="completed puzzle" width="617" height="440" /></a></p>
<p>You can access the puzzle (sample form) <a title="Click here to open the puzzle..." href="http://assurehsc.ie/blog/wp-content/uploads/2010/06/2009-08-12-Jigsaw-puzzle.pdf" target="_blank">here</a>.</p>
<p>In case you don&#8217;t make it to the end of the puzzle, here is the video of Hook Head lighthouse.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="405" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/s-1OJb03SPI&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;color1=0x234900&amp;color2=0x4e9e00&amp;border=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="500" height="405" src="http://www.youtube.com/v/s-1OJb03SPI&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;color1=0x234900&amp;color2=0x4e9e00&amp;border=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://assurehsc.ie/blog/index.php/2010/06/picture-puzzle/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Keeping track of scores</title>
		<link>http://assurehsc.ie/blog/index.php/2010/05/keeping-track-of-scores/</link>
		<comments>http://assurehsc.ie/blog/index.php/2010/05/keeping-track-of-scores/#comments</comments>
		<pubDate>Mon, 31 May 2010 19:21:38 +0000</pubDate>
		<dc:creator>Niall O'Donovan</dc:creator>
				<category><![CDATA[LiveCycle]]></category>
		<category><![CDATA[Samples]]></category>
		<category><![CDATA[LC Designer]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[XFA Form]]></category>

		<guid isPermaLink="false">http://assurehsc.ie/blog/?p=99</guid>
		<description><![CDATA[Forms can de used to ask users questions. Sometimes the question is a simple yes or no. Other times you may have questions with more than two choices or with complicated scoring requirements. This sample will show you two options for keeping scores. The first sample considers a series of yes/no questions. Each question is [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fassurehsc.ie%2Fblog%2Findex.php%2F2010%2F05%2Fkeeping-track-of-scores%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fassurehsc.ie%2Fblog%2Findex.php%2F2010%2F05%2Fkeeping-track-of-scores%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Forms can de used to ask users questions. Sometimes the question is a simple yes or no. Other times you may have questions with more than two choices or with complicated scoring requirements. This sample will show you two options for keeping scores. <span id="more-99"></span></p>
<p>The first sample considers a series of yes/no questions. Each question is bound to a radio group where yes scores 1 and no scores 0 (zero). This is relatively easy to keep track of, because a simple sum function or addition of the rawValues will keep the overall score.</p>
<p>On the other hand, once you introduce more than two options, with differing marking schemes things can become a little heated.</p>
<p>The main thing is to plan out the approach first, as this can affect how you are going to name objects. For example in the second sample we have used a loop to look at each of the questions in turn. Using loops help keep your script lean and maintainable. But to get the most out a loop, it is easier if the objects have the same name. The loop then just looks at each instance of the specified objects.</p>
<p>Have a look at the sample which is available here:</p>
<p>The sample for is available <a title="Click here to open the sample form in Acrobat/Reader..." href="http://assurehsc.ie/blog/wp-content/uploads/2010/06/2010-06-02-Scoring-three-options.pdf" target="_blank">here</a>.</p>
<p>The main scripts are shown within the page layout. If you open the form in LC Designer you can dive right into the scripts. Please feel free to make changes and to adapt these examples to suit your requirements.</p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://assurehsc.ie/blog/index.php/2010/05/keeping-track-of-scores/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Repeating non-null table data</title>
		<link>http://assurehsc.ie/blog/index.php/2010/05/repeating-non-null-table-data/</link>
		<comments>http://assurehsc.ie/blog/index.php/2010/05/repeating-non-null-table-data/#comments</comments>
		<pubDate>Sun, 30 May 2010 11:46:12 +0000</pubDate>
		<dc:creator>Niall O'Donovan</dc:creator>
				<category><![CDATA[Samples]]></category>
		<category><![CDATA[LC Designer]]></category>

		<guid isPermaLink="false">http://assurehsc.ie/blog/?p=70</guid>
		<description><![CDATA[There may be situations where you only want the user to print a table with rows that contain data. This is particularly useful where a user is presented with a table containing many rows. Once the user has selected the rows that are applicable, the print buttons allow the user to print only the information [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fassurehsc.ie%2Fblog%2Findex.php%2F2010%2F05%2Frepeating-non-null-table-data%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fassurehsc.ie%2Fblog%2Findex.php%2F2010%2F05%2Frepeating-non-null-table-data%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>There may be situations where you only want the user to print a table with rows that contain data. This is particularly useful where a user is presented with a table containing many rows. Once the user has selected the rows that are applicable, the print buttons allow the user to print only the information that is relevant. <span id="more-70"></span></p>
<p>Here is a sample, which examines two options:</p>
<ol>
<li>Hide the rows that are not selected before printing and then restore after printing.</li>
<li>Hide the page containing the table and show a hidden page, which contains a dynamic table that is populated with the rows that the user has already selected. After printing the original page is restored.</li>
</ol>
<p>The form contains two print buttons with script in the click and postPrint events. When you have decided on a method, you could mode the portion of the script dealing with presence, to the prePrint event, so that the same behaviour will occur when the user selects print from the menu.</p>
<p>The click event of the print button hiding the null rows includes this loop:</p>
<p><em>for (var i=0; i&lt;=13; i++)</em></p>
<p><em>{</em></p>
<p style="padding-left: 30px;"><em>var oRow = xfa.resolveNode(&#8220;Table1.Row1[" + i + "]&#8220;);</em></p>
<p style="padding-left: 30px;"><em>if (oRow.supply.rawValue == &#8220;0&#8243;)</em></p>
<p style="padding-left: 30px;"><em>{</em></p>
<p style="padding-left: 60px;"><em>oRow.presence = &#8220;hidden&#8221;;</em></p>
<p style="padding-left: 30px;"><em>}</em></p>
<p><em>}</em></p>
<p>We have also included a performance indicator, from <a title="John Brinkman's blog" href="http://blogs.adobe.com/formfeed/" target="_blank">John Brinkman&#8217;s blog</a>. This indicates that the first option is more efficient, generally completing the hide script within 6 milliseconds. The second option&#8217;s performance decreases as more rows need to be duplicated on the second table. For example duplicating 14 rows took on average 35 milliseconds.</p>
<p>Overall, the first option is the cleanest, more robust and more efficient.</p>
<p>You can download the sample <a title="Click here to open the form in Acrobat/Reader" href="http://assurehsc.ie/blog/wp-content/uploads/2010/05/2010-05-28-Duplicate-table-data-if-not-null1.pdf" target="_blank">here</a>.</p>
<p>The sample can be opened in Acrobat/Reader. If you want to examine the script you will need to open the sample in LiveCycle Designer ES2.</p>
]]></content:encoded>
			<wfw:commentRss>http://assurehsc.ie/blog/index.php/2010/05/repeating-non-null-table-data/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
