<?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>Mea Cup O' Jo &#187; jQuery</title>
	<atom:link href="http://dev.bostone.us/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.bostone.us</link>
	<description>Jump Right Ahead In My Web</description>
	<lastBuildDate>Mon, 12 Dec 2011 18:30:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Don&#8217;t mix &#8211; it will give you a headache!</title>
		<link>http://dev.bostone.us/2009/06/24/dont-mix-it-will-give-you-a-headache/</link>
		<comments>http://dev.bostone.us/2009/06/24/dont-mix-it-will-give-you-a-headache/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 23:28:01 +0000</pubDate>
		<dc:creator>bo</dc:creator>
				<category><![CDATA[Web stuff]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://dev.bostone.us/?p=187</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>Remember that old college wisdom? Well &#8211; mixing markup, styles and logic will give you bad one for sure. Here are some things you should always exercise when writing your JSP</p>
<ul>
<li>It&#8217;s already awful because of HTML/JSP special syntax mix. Do not place more than a single line of JS in that code &#8211; keep it in external, linked JS file, such code has no business to be directly in JSP.</li>
<li>JS event handling. If you are putting JS code into tag attributes (e.g. <tt>&lt;input onclick="doSomething()"/&gt;</tt>) then you still living in XX century. Especially if you are using jQuery. All your events should be defined in JS code and be triggered within <tt>document.onload</tt> event
<div style="border-width: 1px;">
<div>
<pre>$(<span>function</span>()
{ // put all your jQuery goodness <span>in</span> here. }
)</pre>
</div>
</div>
</li>
<li> Laying out pages with table except when you are displaying actual tabular data is a lazy habit. That&#8217;s what CSS is for. Takes time to learn but makes your pages faster and less clattered with unnecessary markup. In my mind &#8211; nested tables are worth than nested for-loops</li>
<li>Avoid putting Java code into your JSP. If you have more than one line you need to have method in your Java code. Matter of fact &#8211; using plain JSP should be avoided and XHTML should be used instead</li>
<li>Do not use color names in your styles e.g. <tt>&lt;tr style="background-color: PeachPuff"&gt;</tt> use color codes (#FFDAB9 ) And that&#8217;s beside the point that you should avoid peppering your markup with inline CSS</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dev.bostone.us/2009/06/24/dont-mix-it-will-give-you-a-headache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autocomplete + Drop-down p.2</title>
		<link>http://dev.bostone.us/2009/04/21/autocomplete-drop-down-p2/</link>
		<comments>http://dev.bostone.us/2009/04/21/autocomplete-drop-down-p2/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 21:43:54 +0000</pubDate>
		<dc:creator>bo</dc:creator>
				<category><![CDATA[Web stuff]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://dev.bostone.us/?p=118</guid>
		<description><![CDATA[So I decided not use 2 different controls but instead to enhance autocomplete with ability to behave as drop-down if number of items fails under specified treshhold. Here are the steps (I&#8217;m using QuickSelect plugin)

Add image button into right side corner of the original input field. I&#8217;m nesting both input and image withing a single [...]]]></description>
			<content:encoded><![CDATA[<p>So I decided not use 2 different controls but instead to enhance autocomplete with ability to behave as drop-down if number of items fails under specified treshhold. Here are the steps (I&#8217;m using QuickSelect plugin)</p>
<ol>
<li>Add image button into right side corner of the original input field. I&#8217;m nesting both input and image withing a single div and then position image as absolute</li>
<li>QuickSelect creates quick object that contains all the data that I need. The problem is &#8211; this object is private and I cannot access it. Unfortunately the only way is to hack into code. I ended up adding a filed to the original Input that creates a reference to Quick object, then in my code I refer to it as $(&#8217;#myQuick&#8217;)[0].quick.<br />
Then I call (fortunately public) method of QuickSelect to populate drop-down list (glorified UL list) with the data and associate that code with onClick event of the button I created in step #1. The code looks something like this:
<pre name="code" class="js">
            if (data.length < 20) {
                var btt = $('<button class="control" type="button">');
                control.after(btt);
                btt.click( function() {
                    var quick = control[0].quick;
                    quick.populate_list('', quick.options.data);
                });
            }</pre>
</li>
</ol>
<p>The result is &#8211; pleasantly looking dropdown that as added bonus maintains autocomplete functionality</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.bostone.us/2009/04/21/autocomplete-drop-down-p2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autocomplete vs. Drop-down</title>
		<link>http://dev.bostone.us/2009/04/12/autocomplete-vs-drop-down/</link>
		<comments>http://dev.bostone.us/2009/04/12/autocomplete-vs-drop-down/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 20:31:00 +0000</pubDate>
		<dc:creator>bostone</dc:creator>
				<category><![CDATA[Web stuff]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://dev.bostone.us/?p=99</guid>
		<description><![CDATA[I&#8217;m working on the project where I have form with 4 select boxes. The problem is that selects are backed by the db tables and can vary in size (grow or shrink). If the select grows back beyond 20-30 entries it becomes pretty much unusable and that&#8217;s when I want it to become an autocomplete [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on the project where I have form with 4 select boxes. The problem is that selects are backed by the db tables and can vary in size (grow or shrink). If the select grows back beyond 20-30 entries it becomes pretty much unusable and that&#8217;s when I want it to become an autocomplete field.<br />
I&#8217;m using QuickSelect as autocomplete and was thinking to extend it to support drop-down functionality.<br />
And then it struck me &#8211; there&#8217;s absolutely no need! All I need to do is at the run time determine how many entries are going into the control and then initialize the input box to ether drop-down or autocomplete which could be separate plug-ins. On Monday I&#8217;ll add some code examples on how to do it but I think that will work just fine</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.bostone.us/2009/04/12/autocomplete-vs-drop-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

