<?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>lejnieks &#187; Php</title>
	<atom:link href="http://www.lejnieks.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lejnieks.com</link>
	<description></description>
	<lastBuildDate>Fri, 29 Jan 2010 19:22:21 +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>Flex Google Style Inline Auto Suggest Search Field</title>
		<link>http://www.lejnieks.com/2008/09/05/flex-google-style-inline-auto-suggest-search-field/</link>
		<comments>http://www.lejnieks.com/2008/09/05/flex-google-style-inline-auto-suggest-search-field/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 16:26:22 +0000</pubDate>
		<dc:creator>klejnieks</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://lejnieks.com/?p=32</guid>
		<description><![CDATA[A quick little POC for building a drop down inline auto suggest, google style search field. The search is hitting a MySQL database populated with over 30,000 records, mind you some / a lot of them are duplicates and laziness forces me not to clean the data for this POC but it still proves the [...]]]></description>
			<content:encoded><![CDATA[<p>A quick little POC for building a drop down inline auto suggest, google style search field. The search is hitting a MySQL database populated with over 30,000 records, mind you some / a lot of them are duplicates and laziness forces me not to clean the data for this POC but it still proves the point. <span id="more-32"></span></p>
<p>Try it out below, you can see instant responses from the server back to flex creating a very responsive and realtime feel. The search is looking through over 30,000 records. View source is enabled as well. Click on the Search text field and try searching for general things like the letter &#8220;A&#8221; or more fine grained terms like &#8220;Led&#8221;. The search polls the database on a short interval using setTimeout().</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">onKeyUp</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:KeyboardEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> TextInput<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">currentTarget</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">text</span>.<span style="color: #0066CC;">length</span> <span style="color: #66cc66;">!</span>= <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		__interval = setTimeout<span style="color: #66cc66;">&#40;</span>query, <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #b1b100;">else</span>
	<span style="color: #66cc66;">&#123;</span>
		dgUserRequest.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><br/></p>
<p>You can modify the interval length, but from my testing I felt that 100 milliseconds was a good time for someone to type letter by letter and see instant responses, as well as not slow someone down who types rather fast and knows the search terms they are looking for.</p>
<p><object type="application/x-shockwave-flash" data="http://projects.lejnieks.com/flex_inline_search_poc/inline_search.swf" width="425" height="355" class="embedflash"><param name="movie" value="http://projects.lejnieks.com/flex_inline_search_poc/inline_search.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><small>(Please open the article to see the flash file or player.)</small></object></p>
<p>Source includes the MySQL database, Request.php which proctors the requests, and all the flex goodness. Source can be found here: <a href="http://projects.lejnieks.com/flex_inline_search_poc/inline_search.swf">http://projects.lejnieks.com/flex_inline_search_poc/inline_search.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejnieks.com/2008/09/05/flex-google-style-inline-auto-suggest-search-field/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
