<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" 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/" > <channel><title>Comments on: Tutorial: Create Autocomplete feature with Java &#8211; JSP / jQuery</title> <atom:link href="http://viralpatel.net/blogs/2009/06/tutorial-create-autocomplete-feature-with-java-jsp-jquery.html/feed" rel="self" type="application/rss+xml" /><link>http://viralpatel.net/blogs/2009/06/tutorial-create-autocomplete-feature-with-java-jsp-jquery.html</link> <description>Tutorials, Java, J2EE, Struts, AJAX, JavaScript, CSS, Web 2.0, MySQL, Articles</description> <lastBuildDate>Thu, 09 Feb 2012 07:08:35 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Jigish</title><link>http://viralpatel.net/blogs/2009/06/tutorial-create-autocomplete-feature-with-java-jsp-jquery.html/comment-page-3#comment-25778</link> <dc:creator>Jigish</dc:creator> <pubDate>Thu, 02 Feb 2012 06:02:02 +0000</pubDate> <guid isPermaLink="false">http://viralpatel.net/blogs/?p=1376#comment-25778</guid> <description>Thankss a lot</description> <content:encoded><![CDATA[<p>Thankss a lot</p> ]]></content:encoded> </item> <item><title>By: chlin</title><link>http://viralpatel.net/blogs/2009/06/tutorial-create-autocomplete-feature-with-java-jsp-jquery.html/comment-page-3#comment-24981</link> <dc:creator>chlin</dc:creator> <pubDate>Wed, 18 Jan 2012 08:40:43 +0000</pubDate> <guid isPermaLink="false">http://viralpatel.net/blogs/?p=1376#comment-24981</guid> <description>thanks a lot</description> <content:encoded><![CDATA[<p>thanks a lot</p> ]]></content:encoded> </item> <item><title>By: Roopesh</title><link>http://viralpatel.net/blogs/2009/06/tutorial-create-autocomplete-feature-with-java-jsp-jquery.html/comment-page-3#comment-24172</link> <dc:creator>Roopesh</dc:creator> <pubDate>Thu, 12 Jan 2012 19:16:38 +0000</pubDate> <guid isPermaLink="false">http://viralpatel.net/blogs/?p=1376#comment-24172</guid> <description>Hi ...Thanks alot ..This does work cool ... Could  u please suggest how to generate an action when the user clicks on any suggestion disaplyed .. say , For example : In the Example you illustrated i need to direct the user to &#039;www.abc.com&#039; when he/she selects &#039;Angola&#039; .</description> <content:encoded><![CDATA[<p>Hi &#8230;Thanks alot ..This does work cool &#8230;<br /> Could  u please suggest how to generate an action when the user clicks on any suggestion disaplyed ..<br /> say , For example : In the Example you illustrated i need to direct the user to &#8216;www.abc.com&#8217; when he/she selects &#8216;Angola&#8217; .</p> ]]></content:encoded> </item> <item><title>By: Viral Patel</title><link>http://viralpatel.net/blogs/2009/06/tutorial-create-autocomplete-feature-with-java-jsp-jquery.html/comment-page-3#comment-23919</link> <dc:creator>Viral Patel</dc:creator> <pubDate>Wed, 11 Jan 2012 10:18:20 +0000</pubDate> <guid isPermaLink="false">http://viralpatel.net/blogs/?p=1376#comment-23919</guid> <description>Thanks Kishore :-)</description> <content:encoded><![CDATA[<p>Thanks Kishore <img src='http://viralpatel.net/blogs/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: m.kishore kumar reddy</title><link>http://viralpatel.net/blogs/2009/06/tutorial-create-autocomplete-feature-with-java-jsp-jquery.html/comment-page-3#comment-23903</link> <dc:creator>m.kishore kumar reddy</dc:creator> <pubDate>Wed, 11 Jan 2012 09:08:57 +0000</pubDate> <guid isPermaLink="false">http://viralpatel.net/blogs/?p=1376#comment-23903</guid> <description>thanks for giving this example ....its realy so good try it once</description> <content:encoded><![CDATA[<p>thanks for giving this example &#8230;.its realy so good try it once</p> ]]></content:encoded> </item> <item><title>By: Rahman</title><link>http://viralpatel.net/blogs/2009/06/tutorial-create-autocomplete-feature-with-java-jsp-jquery.html/comment-page-3#comment-23164</link> <dc:creator>Rahman</dc:creator> <pubDate>Sun, 08 Jan 2012 12:02:44 +0000</pubDate> <guid isPermaLink="false">http://viralpatel.net/blogs/?p=1376#comment-23164</guid> <description>Thank you for your quick replyProblem solved when I wrote the piece of code below where empIdTT is a hidden field [code language=&quot;js&quot;] $(&quot;#country&quot;).result(function(event, data, formatted) { if (data) $(&quot;#empIdTT&quot;).val(data[1]); }); [/code]</description> <content:encoded><![CDATA[<p>Thank you for your quick reply</p><p>Problem solved when I wrote the piece of code below where empIdTT is a hidden field</p><pre class="brush: jscript; title: ; notranslate">
	$(&quot;#country&quot;).result(function(event, data, formatted) {
		if (data)
		$(&quot;#empIdTT&quot;).val(data[1]);
	});
</pre>]]></content:encoded> </item> <item><title>By: Viral Patel</title><link>http://viralpatel.net/blogs/2009/06/tutorial-create-autocomplete-feature-with-java-jsp-jquery.html/comment-page-3#comment-22077</link> <dc:creator>Viral Patel</dc:creator> <pubDate>Thu, 05 Jan 2012 17:35:52 +0000</pubDate> <guid isPermaLink="false">http://viralpatel.net/blogs/?p=1376#comment-22077</guid> <description>@Rahman: I assume you have a requirement where user can select Employee name in autocomplete box and the selected employee&#039;s emp_id should be stored in a hidden field.To do this consider following code snippet:[code language=&quot;js&quot;] var data = [ {emp_name:&#039;Employee A&#039;, emp_id:&#039;121&#039;}, {emp_name:&#039;Employee B&#039;, emp_id: &#039;345&#039;} ]; $(&quot;...&quot;).autocomplete(data, { formatItem: function(item) { return item.emp_name; } }).result(function(event, item) { $(&#039;#hidden_field&#039;).val(item.emp_id); }); [/code]Here in above code, your jsp generates output in JSon format [ {emp_name:&#039;Employee A&#039;, emp_id:&#039;121&#039;}, {emp_name:&#039;Employee B&#039;, emp_id: &#039;345&#039;} ]. Both emp_name and emp_id are present in the json output.Also the hidden field id is &quot;hidden_field&quot; whose value we set in result() method.Hope this helps you have solves your problem.</description> <content:encoded><![CDATA[<p>@Rahman: I assume you have a requirement where user can select Employee name in autocomplete box and the selected employee&#8217;s emp_id should be stored in a hidden field.</p><p>To do this consider following code snippet:</p><pre class="brush: jscript; title: ; notranslate">
var data = [ {emp_name:'Employee A', emp_id:'121'}, {emp_name:'Employee B', emp_id: '345'} ];
$(&quot;...&quot;).autocomplete(data, {
  formatItem: function(item) {
    return item.emp_name;
  }
}).result(function(event, item) {
    $('#hidden_field').val(item.emp_id);
});
</pre><p>Here in above code, your jsp generates output in JSon format [ {emp_name:'Employee A', emp_id:'121'}, {emp_name:'Employee B', emp_id: '345'} ]. Both emp_name and emp_id are present in the json output.</p><p>Also the hidden field id is &#8220;hidden_field&#8221; whose value we set in result() method.</p><p>Hope this helps you have solves your problem.</p> ]]></content:encoded> </item> <item><title>By: Viral Patel</title><link>http://viralpatel.net/blogs/2009/06/tutorial-create-autocomplete-feature-with-java-jsp-jquery.html/comment-page-3#comment-22076</link> <dc:creator>Viral Patel</dc:creator> <pubDate>Thu, 05 Jan 2012 17:25:08 +0000</pubDate> <guid isPermaLink="false">http://viralpatel.net/blogs/?p=1376#comment-22076</guid> <description>@Naveen - You can pass the extra parameters like this:[code language=&quot;js&quot;] $(&#039;#country&#039;).autocomplete(&quot;getdata.jsp&quot;, {extraParams: {bar: 4 }} ); // This will generate url like: // getdata.jsp?q=some&amp;bar=4 [/code]Hope that helps. </description> <content:encoded><![CDATA[<p>@Naveen &#8211; You can pass the extra parameters like this:</p><pre class="brush: jscript; title: ; notranslate">
$('#country').autocomplete(&quot;getdata.jsp&quot;, {extraParams: {bar: 4 }} );
// This will generate url like:
// getdata.jsp?q=some&amp;bar=4
</pre><p>Hope that helps.</p> ]]></content:encoded> </item> <item><title>By: Rahman</title><link>http://viralpatel.net/blogs/2009/06/tutorial-create-autocomplete-feature-with-java-jsp-jquery.html/comment-page-3#comment-22023</link> <dc:creator>Rahman</dc:creator> <pubDate>Thu, 05 Jan 2012 14:26:59 +0000</pubDate> <guid isPermaLink="false">http://viralpatel.net/blogs/?p=1376#comment-22023</guid> <description>Hi I&#039;m newbie in jQuery, autocomplete works fine getting employee names using this code /* employeeData.jsp */ [code language=&quot;java&quot;] empV=empItt.empAutoComplete(); Iterator it=empV.iterator(); while (it.hasNext()){ String myId=(String)it.next(); String myName=(String)it.next(); out.write(myName+&quot;\n&quot;); } [/code]/* main page */ [code language=&quot;js&quot;] jQuery(function(){ $(&quot;#country&quot;).autocomplete(&quot;employeeData.jsp&quot;); }); [/code] But I failed to get the employee id in hidden field, Please what the method  I should use to get the id in hidden field Thanks in advance</description> <content:encoded><![CDATA[<p>Hi<br /> I&#8217;m newbie in jQuery,<br /> autocomplete works fine getting employee names using this code<br /> /* employeeData.jsp */</p><pre class="brush: java; title: ; notranslate">
empV=empItt.empAutoComplete();
Iterator it=empV.iterator();
while (it.hasNext()){
	String myId=(String)it.next();
	String myName=(String)it.next();
       out.write(myName+&quot;\n&quot;);
}
</pre><p>/* main page */</p><pre class="brush: jscript; title: ; notranslate">
jQuery(function(){
	$(&quot;#country&quot;).autocomplete(&quot;employeeData.jsp&quot;);

});
</pre><p>But I failed to get the employee id in hidden field, Please what the method  I should use<br /> to get the id in hidden field<br /> Thanks in advance</p> ]]></content:encoded> </item> <item><title>By: Naveen</title><link>http://viralpatel.net/blogs/2009/06/tutorial-create-autocomplete-feature-with-java-jsp-jquery.html/comment-page-3#comment-22016</link> <dc:creator>Naveen</dc:creator> <pubDate>Thu, 05 Jan 2012 14:12:04 +0000</pubDate> <guid isPermaLink="false">http://viralpatel.net/blogs/?p=1376#comment-22016</guid> <description>thanks for the code its works fine.... but i want to know how to pass extra parameters</description> <content:encoded><![CDATA[<p>thanks for the code its works fine&#8230;. but i want to know how to pass extra parameters</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: viralpatel.net @ 2012-02-09 14:11:51 -->
