<?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>Indeed, the website.</title>
	<atom:link href="http://aaron.ajexperience.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://aaron.ajexperience.com</link>
	<description>A programmer&#039;s thoughts on work, life, and other stuff.</description>
	<lastBuildDate>Fri, 09 Dec 2011 22:00:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Pinterest Pin It Button on the iPad</title>
		<link>http://aaron.ajexperience.com/2011/11/25/pinterest-pin-it-button-on-the-ipad/</link>
		<comments>http://aaron.ajexperience.com/2011/11/25/pinterest-pin-it-button-on-the-ipad/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 20:48:14 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[iPad]]></category>
		<category><![CDATA[Safari]]></category>

		<guid isPermaLink="false">http://aaron.ajexperience.com/?p=816</guid>
		<description><![CDATA[Pinterest is an image based link sharing website that&#8217;s become fairly popular lately. It has a &#8220;Pin It&#8221; button that can normally be dragged to the bookmark bar and added as a link in your browser to make it easy to &#8220;pin&#8221; things. Of course, you can&#8217;t drag a link on the iPad! There is <a href='http://aaron.ajexperience.com/2011/11/25/pinterest-pin-it-button-on-the-ipad/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://aaron.ajexperience.com/wp-content/uploads/2011/12/ipad-official.jpg"><img class="size-medium wp-image-823 alignright" title="ipad-official" src="http://aaron.ajexperience.com/wp-content/uploads/2011/12/ipad-official-300x177.jpg" alt="" width="300" height="177" /></a>Pinterest is an image based link sharing website that&#8217;s become fairly popular lately. It has a &#8220;Pin It&#8221; button that can normally be dragged to the bookmark bar and added as a link in your browser to make it easy to &#8220;pin&#8221; things. Of course, you can&#8217;t drag a link on the iPad! There is an iPad App for Pinterest, and from what I&#8217;ve heard it leaves something to be desired. So here&#8217;s how to get a Pin It button on the iPad, iPad2, or anything else that supports running JavaScript in a bookmark but doesn&#8217;t allow you to drag and drop a link.</p>
<p>The &#8220;Pin It&#8221; button is just a link with some JavaScript in it, so we will create a custom bookmark on the iPad with the correct JavaScript and it will work as expected.</p>
<ul>
<li>Find the custom JavaScript.</li>
</ul>
<ol>
<li>You can try copying and pasting the JavaScript from here, but it may change in the future. If it doesn&#8217;t work, then continue on to the next step in this section. Do include the &#8220;javascript:&#8221; at the beginning &#8211; it&#8217;s absolutely necessary.</li>
<ol>
<li>
<pre>javascript:void((function(){var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)})());</pre>
</li>
</ol>
<li>Open Safari on an actual computer (you may need to install it on Windows). Or just install one of those User Agent Switchers and tell Pinterest that you&#8217;re using Safari, if you know what you&#8217;re doing&#8230;</li>
<li>Log in to Pinterest and get the &#8220;Pin It&#8221; button from the &#8220;About&#8221; menu, and drag it to your bookmarks.</li>
<li>Edit the bookmark and copy the address of the bookmark, which should start with &#8220;javascript:&#8221;</li>
</ol>
<ul>
<li>Get the bookmark text on to your iPad. Probably the easiest way to do this is by emailing it somewhere and setting up that email on the iPad.</li>
<li>Copy the entire text of the bookmark, including the &#8220;javascript:&#8221;</li>
<li>Create a bookmark on the iPad (for anything, it is changed in the next step).</li>
<li>Edit the bookmark you created, name it &#8220;Pin It!&#8221;, paste the javascript:&#8230; text into the location/address part of the bookmark.</li>
<li>Click the &#8220;Pin It!&#8221; bookmark on any page with an image to get the popup window where you choose which photo to use. This look slightly different on the iPad but has the same functionality.</li>
<li>Rejoice in Pinterest goodness.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://aaron.ajexperience.com/2011/11/25/pinterest-pin-it-button-on-the-ipad/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>iPhoto Movie Importing</title>
		<link>http://aaron.ajexperience.com/2011/07/01/iphoto-movie-importing/</link>
		<comments>http://aaron.ajexperience.com/2011/07/01/iphoto-movie-importing/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 01:49:16 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[iPhoto]]></category>

		<guid isPermaLink="false">http://aaron.ajexperience.com/?p=811</guid>
		<description><![CDATA[Some people have had issues importing various movie formats into iPhoto. Even .MOV QuickTime movies sometimes don&#8217;t play correctly in iMovie. .MTS files from Sony cameras simply will not work &#8211; they need to be converted. If you have the choice of a conversion format, use the H.264 format which may have an extension of <a href='http://aaron.ajexperience.com/2011/07/01/iphoto-movie-importing/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Some people have had issues importing various movie formats into iPhoto. Even .MOV QuickTime movies sometimes don&#8217;t play correctly in iMovie. .MTS files from Sony cameras simply will not work &#8211; they need to be converted. If you have the choice of a conversion format, use the H.264 format which may have an extension of .mp4. This works fine and may be the very format that iPhoto itself uses.</p>
<p>You can see the format that iPhoto uses by choosing a video that has already been imported (and plays correctly). Then click File -&gt; Reveal in Finder -&gt; Original File. Then right-click and choose Get Info. Under &#8220;More Info&#8221; there is a Codecs listing which shows the codec of the video.</p>
<p>A good converter is <a title="Xilisoft HD Video Converter" href="http://www.xilisoft.com/hd-video-converter.html" target="_blank">Xilisoft HD Video Converter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://aaron.ajexperience.com/2011/07/01/iphoto-movie-importing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSF2 Issues and Complaints</title>
		<link>http://aaron.ajexperience.com/2011/04/19/jsf2-issues-and-complaints/</link>
		<comments>http://aaron.ajexperience.com/2011/04/19/jsf2-issues-and-complaints/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 03:56:13 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Complaints]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[JSF 2]]></category>

		<guid isPermaLink="false">http://aaron.ajexperience.com/?p=794</guid>
		<description><![CDATA[The following are things that I think could be improved upon in JSF2. 1) There is no colspan (or rowspan) attribute for panelGrid. Something like this would be useful, for example if you want full control of the tables JSF creates for you for specific formatting. There are a couple of ways to get around <a href='http://aaron.ajexperience.com/2011/04/19/jsf2-issues-and-complaints/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>The following are things that I think could be improved upon in JSF2.</p>
<h2>1) There is no colspan (or rowspan) attribute for panelGrid.</h2>
<p>Something like this would be useful, for example if you want full control of the tables JSF creates for you for specific formatting. There are a couple of ways to get around this. One method is to not use a panelGrid and just use a plain old html table. Of course, if you use a plain html then you&#8217;ll have to wrap it something (like a panelGrid for instance) if you&#8217;d like the table to be rerendered with some AJAX.</p>
<p>The other way around this is knowing that the panelGrid does offer headers and footers for the table it creates for you. This may be acceptable for your design.</p>
<div class="codecolorer-container xml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;header&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:outputText</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;I am header text and I take up many columns.&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>and</p>
<div class="codecolorer-container xml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;footer&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:outputText</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;I am footer text and I take up many columns.&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<h2>2) A Boolean value on a bean is set to false instead of being left as null when the form is submitted.</h2>
<p>There isn&#8217;t much to say about this. It&#8217;s &#8220;Boolean&#8221; not &#8220;boolean,&#8221; so don&#8217;t touch it if it&#8217;s null! This may have to do with the javax.faces.VALIDATE_EMPTY_FIELDS setting, but in my mind the two should be unrelated. Storing null instead of &#8220;false&#8221; is useful when saving form data to a database and capturing whether the user actually chose false or was defaulted into false. The default should be null if there is a &#8220;no option&#8221; default. The only way around this I&#8217;m aware of at the time of this writing is making the backing bean use a String, giving the &#8220;no option&#8221; option a value of &#8220;null,&#8221; and then turning that &#8220;null&#8221; String into an actual null value before inserting into the database (what a pain).</p>
<h2>3) selectMany check boxes can only be displayed vertically or horizontally.</h2>
<p>What about 2 by 2? 3 by 2? etc. This is another control issue.. The way around this that I found is to create extra methods on the backing bean &#8211; one that returns the first half of the check boxes and one that returns the second half of the check boxes. That way the two methods can be used for two separate columns, thus creating a list of checkboxes that are two-by-two. The annoying thing about doing it this way is that returning a simple</p>
<div class="codecolorer-container java twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">list.<span style="color: #006633;">sublist</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, list.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>doesn&#8217;t really work. Since JSF wants to set data on the list instead of just looking at it, you may need to actually truly have two lists on the backing bean. Then dealing with it as one list requires some additional workarounds. That&#8217;s what I had to do&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://aaron.ajexperience.com/2011/04/19/jsf2-issues-and-complaints/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The terminal server has exceeded the maximum number of allowed connections.</title>
		<link>http://aaron.ajexperience.com/2011/04/12/the-terminal-server-has-exceeded-the-maximum-number-of-allowed-connections/</link>
		<comments>http://aaron.ajexperience.com/2011/04/12/the-terminal-server-has-exceeded-the-maximum-number-of-allowed-connections/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 03:51:26 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Remote Desktop]]></category>

		<guid isPermaLink="false">http://aaron.ajexperience.com/?p=788</guid>
		<description><![CDATA[Here&#8217;s how to kick people off of the server in case they leave for the day (or for lunch) and leave their RDC (Remote Desktop Client) open. *open a command prompt to \windows\system32\dllcache *type the following&#8230;: query session /server:etltst01 *type the following&#8230;.: reset session X /server:etltst01 where X is the ID of the person to <a href='http://aaron.ajexperience.com/2011/04/12/the-terminal-server-has-exceeded-the-maximum-number-of-allowed-connections/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how to kick people off of the server in case they leave for the day (or for lunch) and leave their RDC (Remote Desktop Client) open.</p>
<p>*open a command prompt to \windows\system32\dllcache</p>
<p>*type the following&#8230;:    query session /server:etltst01</p>
<p>*type the following&#8230;.:   reset session X /server:etltst01<br />
where X is the ID of the person to boot.</p>
<p>from <a href="http://www.howtogeek.com/howto/windows/command-line-hack-for-terminal-server-has-exceeded-the-maximum-number-of-allowed-connections/" target="_blank">http://www.howtogeek.com/howto/windows/command-line-hack-for-terminal-server-has-exceeded-the-maximum-number-of-allowed-connections/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://aaron.ajexperience.com/2011/04/12/the-terminal-server-has-exceeded-the-maximum-number-of-allowed-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java 1.6 ConcurrentHashSet</title>
		<link>http://aaron.ajexperience.com/2011/04/08/781/</link>
		<comments>http://aaron.ajexperience.com/2011/04/08/781/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 19:48:53 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Concurrency]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[set]]></category>

		<guid isPermaLink="false">http://aaron.ajexperience.com/?p=781</guid>
		<description><![CDATA[What&#8217;s that? You&#8217;ve never heard of the ConcurrentHashSet before? It didn&#8217;t work out with the compiler? You may have typed it wrong. Try typing Set&#60;Object&#62; processors = Collections.newSetFromMap&#40; &#160; &#160; new ConcurrentHashMap&#60;Object, Boolean&#62;&#40;&#41;&#41;; From http://dhruba.name/2009/08/05/concurrent-set-implementations-in-java-6/&#160;]]></description>
			<content:encoded><![CDATA[<p>What&#8217;s that? You&#8217;ve never heard of the ConcurrentHashSet before? It didn&#8217;t work out with the compiler? You may have typed it wrong. Try typing</p>
<div class="codecolorer-container java twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Set<span style="color: #339933;">&lt;</span>Object<span style="color: #339933;">&gt;</span> processors <span style="color: #339933;">=</span> <span style="color: #003399;">Collections</span>.<span style="color: #006633;">newSetFromMap</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> ConcurrentHashMap<span style="color: #339933;">&lt;</span><span style="color: #003399;">Object</span>, Boolean<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>From <a href="http://dhruba.name/2009/08/05/concurrent-set-implementations-in-java-6/" target="_blank">http://dhruba.name/2009/08/05/concurrent-set-implementations-in-java-6/</a>&nbsp;</object></code></p>
]]></content:encoded>
			<wfw:commentRss>http://aaron.ajexperience.com/2011/04/08/781/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSF2 Set Focus to Invalid Input Components</title>
		<link>http://aaron.ajexperience.com/2011/04/02/jsf2-set-focus-to-invalid-input-components/</link>
		<comments>http://aaron.ajexperience.com/2011/04/02/jsf2-set-focus-to-invalid-input-components/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 08:54:36 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[JSF 2]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[invalid components]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jsf2]]></category>
		<category><![CDATA[set focus]]></category>

		<guid isPermaLink="false">http://aaron.ajexperience.com/?page_id=761</guid>
		<description><![CDATA[Sometimes it&#8217;s desirable to set focus to the the invalid component instead of only displaying a message about the invalid component. This is especially true when tabs are used and the invalid component may not be visible to the user at all, leaving the submit button apparently unresponsive when it&#8217;s actually displaying the message on <a href='http://aaron.ajexperience.com/2011/04/02/jsf2-set-focus-to-invalid-input-components/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes it&#8217;s desirable to set focus to the the invalid component instead of only displaying a message about the invalid component. This is especially true when tabs are used and the invalid component may not be visible to the user at all, leaving the submit button apparently unresponsive when it&#8217;s actually displaying the message on a different tab. The code works as follows and depends on the following.</p>
<p>&#8230;sets focus to invalid input components (empty and required or when an invalid date is entered, for example). It depends on the following things:</p>
<p>&nbsp;</p>
<ol>
<li>the component must have an ID.</li>
<li>The h:message component must have an ID exactly the same as the invalid component except with the additional suffix of &#8220;Message&#8221;.</li>
<li>The h:message component must have the &#8220;errorMessage&#8221; css class specified as one of it&#8217;s classes.</li>
</ol>
<p>This works in the following way.</p>
<ol>
<li>look for components with the &#8220;errorMessage&#8221; class.</li>
<li>removes the &#8220;Message&#8221; suffix from the ID of the component.</li>
<li>find the component with the new ID.</li>
<li>set focus there.</li>
</ol>
<p>On the submit button use the &#8220;onevent&#8221; attribute to trigger javascript.</p>
<div class="codecolorer-container xml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:commandButton</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Submit Claim&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp;<span style="color: #000066;">action</span>=<span style="color: #ff0000;">&quot;#{controller.storeClaim}&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;saveReport&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:ajax</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;action&quot;</span> <span style="color: #000066;">execute</span>=<span style="color: #ff0000;">&quot;@form&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp;<span style="color: #000066;">render</span>=<span style="color: #ff0000;">&quot;allErrorMessages tc1 tc2 tc3 tc4 tc5&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">onevent</span>=<span style="color: #ff0000;">&quot;setFocusToRequiredOrInvalid&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h:commandButton<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>In an included javascript file define the &#8220;setFocusToRequiredOrInvalid&#8221; function as the following.</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006600; font-style: italic;">/** Returns true if the passed in string ends with the passed in suffix. */</span><br />
<span style="color: #003366; font-weight: bold;">function</span> endsWith<span style="color: #009900;">&#40;</span>str<span style="color: #339933;">,</span> suffix<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">return</span> str.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>suffix<span style="color: #339933;">,</span> str.<span style="color: #660066;">length</span> <span style="color: #339933;">-</span> suffix.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
&nbsp;<br />
<span style="color: #006600; font-style: italic;">// set focus to the first required field that is empty.</span><br />
<span style="color: #003366; font-weight: bold;">function</span> setFocusToRequiredOrInvalid<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> setFocusItem <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> tabIndexForFocus <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">/* The following sets focus to invalid input components (empty and required or when an invalid date <br />
&nbsp; &nbsp; &nbsp; &nbsp;* is entered, for example). It depends on the following things:<br />
&nbsp; &nbsp; &nbsp; &nbsp;* 1) the component must have an ID.<br />
&nbsp; &nbsp; &nbsp; &nbsp;* 2) The h:message component must have an ID exactly the same as the invalid component except with <br />
&nbsp; &nbsp; &nbsp; &nbsp;* the additional suffix of &quot;Message&quot;.<br />
&nbsp; &nbsp; &nbsp; &nbsp;* 3) The h:message component must have the &quot;errorMessage&quot; css class specified as one of it's classes.<br />
&nbsp; &nbsp; &nbsp; &nbsp;* This works in the following way:<br />
&nbsp; &nbsp; &nbsp; &nbsp;* 1) look for components with the &quot;errorMessage&quot; class. <br />
&nbsp; &nbsp; &nbsp; &nbsp;* 2) removes the &quot;Message&quot; suffix from the ID of the component.<br />
&nbsp; &nbsp; &nbsp; &nbsp;* 3) find the component with the new ID <br />
&nbsp; &nbsp; &nbsp; &nbsp;* 4) set focus there */</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// look for error message components</span><br />
&nbsp; &nbsp; &nbsp; jQuery.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.errorMessage&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> val<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> componentID <span style="color: #339933;">=</span> val.<span style="color: #660066;">id</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// get the component's ID</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// if the ID ends in &quot;Message&quot; then we named the ID to correspond with an input component</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>endsWith<span style="color: #009900;">&#40;</span>componentID<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;Message&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// get the ID of the component for which this error message refers.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> errorredComponentID <span style="color: #339933;">=</span> componentID.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> componentID.<span style="color: #660066;">length</span> <span style="color: #339933;">-</span> <span style="color: #3366CC;">&quot;Message&quot;</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// select the errored component</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> errorredComponent <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>errorredComponentID<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>errorredComponent <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#40;</span>errorredComponent <span style="color: #339933;">!=</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#40;</span>errorredComponent <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// set the focus to this component</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setFocusItem <span style="color: #339933;">=</span> errorredComponent<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// figure out which tab to switch to</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>setFocusItem <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// get the list of classes for the element. copied from </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// stackoverflow.com/questions/1227286/get-class-list-for-element-with-jquery</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> classList <span style="color: #339933;">=</span>$<span style="color: #009900;">&#40;</span>setFocusItem<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'class'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\s+/</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// look at each class</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> classList.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> value <span style="color: #339933;">=</span> classList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// if the length is correct and it starts with &quot;tab-&quot; then </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// extract the tab number</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>value.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;=</span> <span style="color: #3366CC;">&quot;tab-0&quot;</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>value.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;tab-&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tabIndexForFocus <span style="color: #339933;">=</span> value.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// this means &quot;break;&quot; to jquery</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// look for invalid components by looking for requiredEmpty components. </span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// these components are required to be empty</span><br />
&nbsp; &nbsp; &nbsp; jQuery.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.requiredEmpty&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> val<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// get the first child's node value...</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>val.<span style="color: #660066;">firstChild</span> <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value <span style="color: #339933;">=</span> val.<span style="color: #660066;">firstChild</span>.<span style="color: #660066;">nodeValue</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>setFocusItem <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>value <span style="color: #339933;">==</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>value <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>value <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// find the previousSibling which is an input type for setting focus</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">do</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value <span style="color: #339933;">=</span> val.<span style="color: #660066;">previousSibling</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>value <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>value.<span style="color: #660066;">nodeName</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;INPUT&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>value.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'type'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;hidden&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setFocusItem <span style="color: #339933;">=</span> value<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// switch to the appropriate tab if we should</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tabIndexForFocus <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> $tabs <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tabs'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tabs</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// first tab selected</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $tabs.<span style="color: #660066;">tabs</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'select'</span><span style="color: #339933;">,</span> parseInt<span style="color: #009900;">&#40;</span>tabIndexForFocus<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// switch to tab</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">//$tabs.tabs('select', 1); // switch to tab</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// if we found an empty required item then set the focus there</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>setFocusItem <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setFocusItem.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://aaron.ajexperience.com/2011/04/02/jsf2-set-focus-to-invalid-input-components/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 29.358 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-08 07:07:42 -->

