<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=5079725" />
  <subtitle>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=5079725</id>
  <updated>2026-05-31T09:06:45Z</updated>
  <dc:date>2026-05-31T09:06:45Z</dc:date>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=39155663" />
    <author>
      <name>R. Code you need</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=39155663</id>
    <updated>2014-06-21T14:51:30Z</updated>
    <published>2014-06-21T14:51:30Z</published>
    <summary type="html">Since I didn&amp;#39;t find a good tutorial for how to use Autocomplete with Service Builder JSON service I decided to make one myself.&lt;br /&gt;It uses service builder based &amp;#34;contact&amp;#34; service to find contacts by name and demonstrates how to build custom query template and result parsing.&lt;br /&gt;I&amp;#39;ve implemented a sample datasource, query template, result list locator, result formatter and even the result text locator.&lt;br /&gt;&lt;br /&gt;You can check out the tutorial here: &lt;a href="http://www.codeyouneed.com/aui-autocomplete-service-builder-json/"&gt;AUI Autocomplete with Service Builder JSON/&lt;/a&gt;</summary>
    <dc:creator>R. Code you need</dc:creator>
    <dc:date>2014-06-21T14:51:30Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=26850320" />
    <author>
      <name>Mohammad Azharuddin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=26850320</id>
    <updated>2013-07-29T08:48:37Z</updated>
    <published>2013-07-29T08:48:37Z</published>
    <summary type="html">Hi all&lt;br /&gt;&lt;br /&gt;here input field should not accept duplicate data..there are two &lt;strong&gt;electronics&lt;/strong&gt;.so if user select &lt;strong&gt;electronics &lt;/strong&gt;for the second time it should not accept.Any solution</summary>
    <dc:creator>Mohammad Azharuddin</dc:creator>
    <dc:date>2013-07-29T08:48:37Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=26844938" />
    <author>
      <name>Mohammad Azharuddin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=26844938</id>
    <updated>2013-07-29T06:10:38Z</updated>
    <published>2013-07-29T06:10:38Z</published>
    <summary type="html">Hi Jelmer Kuperus&lt;br /&gt;I implemented autocomplete which takes multiple inputs seperated by comma,which include duplicate as well.so how can i avoid duplicates&lt;br /&gt;&lt;br /&gt;HTH</summary>
    <dc:creator>Mohammad Azharuddin</dc:creator>
    <dc:date>2013-07-29T06:10:38Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=18755201" />
    <author>
      <name>Antonio Musarra</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=18755201</id>
    <updated>2012-12-20T10:07:54Z</updated>
    <published>2012-12-20T10:07:54Z</published>
    <summary type="html">Hi,&lt;br /&gt;Try to see the complete example at &lt;a href="http://musarra.wordpress.com/2012/12/18/alloy-ui-autocomplete-ajax-example/"&gt;Alloy UI AutoComplete Ajax Example&lt;/a&gt;&lt;br /&gt;Instead the repository https://github.com/amusarra/liferay-aui-autocomplete-ajax-example find the complete project format maven.&lt;br /&gt;&lt;br /&gt;Bye,&lt;br /&gt;Antonio.&lt;img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" &gt;</summary>
    <dc:creator>Antonio Musarra</dc:creator>
    <dc:date>2012-12-20T10:07:54Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=15748908" />
    <author>
      <name>Aneesha Rao</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=15748908</id>
    <updated>2012-08-21T09:51:27Z</updated>
    <published>2012-08-21T09:51:27Z</published>
    <summary type="html">Hi,&lt;br /&gt;&lt;br /&gt;How can i use the same code for directory portlet?&lt;br /&gt;I am not able to include it in a hook. &lt;br /&gt;Please help.&lt;br /&gt;&lt;br /&gt;--Regards,&lt;br /&gt;Aneesha</summary>
    <dc:creator>Aneesha Rao</dc:creator>
    <dc:date>2012-08-21T09:51:27Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=15568249" />
    <author>
      <name>Akash Mohan Patil</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=15568249</id>
    <updated>2012-08-13T12:17:57Z</updated>
    <published>2012-08-13T12:17:57Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;jelmer kuperus:&lt;/div&gt;&lt;blockquote&gt;I was playing around with this tonight. attached you will find an example portlet that demonstrates the use of the AutoComplete component.&lt;br /&gt;&lt;br /&gt;it includes both a plain javascript and ajax example.&lt;br /&gt;&lt;br /&gt;I hope this helps&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;HI, Thanks, gr8 war file. easy to understand and customize</summary>
    <dc:creator>Akash Mohan Patil</dc:creator>
    <dc:date>2012-08-13T12:17:57Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=14703054" />
    <author>
      <name>Mazhar Alam</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=14703054</id>
    <updated>2012-07-04T10:58:12Z</updated>
    <published>2012-07-04T10:58:12Z</published>
    <summary type="html">Helpful post</summary>
    <dc:creator>Mazhar Alam</dc:creator>
    <dc:date>2012-07-04T10:58:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=13887330" />
    <author>
      <name>Rakesh Goswami</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=13887330</id>
    <updated>2012-05-11T08:32:36Z</updated>
    <published>2012-05-11T08:32:36Z</published>
    <summary type="html">please check this..I am facing problem on ajax call with alloy UI.&lt;br /&gt;&lt;a href="http://www.liferay.com/community/forums/-/message_boards/message/13886206"&gt;allou ui and ajax&lt;/a&gt;</summary>
    <dc:creator>Rakesh Goswami</dc:creator>
    <dc:date>2012-05-11T08:32:36Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6732991" />
    <author>
      <name>Henry K</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6732991</id>
    <updated>2010-12-07T19:34:52Z</updated>
    <published>2010-12-07T19:34:52Z</published>
    <summary type="html">I can&amp;#39;t get remote data to work with autocomplete. What am I doing wrong? Thanks for any help you can provide.&lt;br /&gt;&lt;br /&gt;drop-down-1 will work just fine, but drop-down-2 returns the exclamation mark.&lt;br /&gt;&lt;br /&gt;http://localhost:8080/c/journal/get_template?groupId=10165&amp;amp;templateId=11803 is simply a template that has [&amp;#34;Chicago&amp;#34;,&amp;#34;Charlotte&amp;#34;,&amp;#34;New York&amp;#34;,&amp;#34;New Brunswick&amp;#34;] as its content.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;h1&amp;gt;No ajax&amp;lt;/h1&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div id=&amp;#34;&amp;lt;portlet:namespace /&amp;gt;drop-down-1&amp;#34;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;aui:script use=&amp;#34;aui-autocomplete&amp;#34;&amp;gt;&lt;br /&gt;&lt;br /&gt;   var cities = [&amp;#34;Chicago&amp;#34;,&amp;#34;Charlotte&amp;#34;,&amp;#34;New York&amp;#34;,&amp;#34;New Brunswick&amp;#34;];&lt;br /&gt;&lt;br /&gt;   new A.AutoComplete(&lt;br /&gt;        {&lt;br /&gt;            dataSource: cities,&lt;br /&gt;            schema: {&lt;br /&gt;                resultFields: [&amp;#39;name&amp;#39;]&lt;br /&gt;            },&lt;br /&gt;            matchKey: &amp;#39;name&amp;#39;,&lt;br /&gt;            delimChar: &amp;#39;,&amp;#39;,&lt;br /&gt;            typeAhead: true,&lt;br /&gt;            contentBox: &amp;#39;#&amp;lt;portlet:namespace /&amp;gt;drop-down-1&amp;#39;&lt;br /&gt;        }&lt;br /&gt;    ).render();&lt;br /&gt;&lt;br /&gt;&amp;lt;/aui:script&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Ajax&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;div id=&amp;#34;&amp;lt;portlet:namespace /&amp;gt;drop-down-2&amp;#34;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;aui:script use=&amp;#34;aui-autocomplete&amp;#34;&amp;gt;&lt;br /&gt;&lt;br /&gt;    var remoteCities = new A.DataSource.IO( { source: &amp;#39;http://localhost:8080/c/journal/get_template?groupId=10165&amp;amp;templateId=11803&amp;#39;} );&lt;br /&gt;&lt;br /&gt;    var autocomplete = new A.AutoComplete(&lt;br /&gt;        {&lt;br /&gt;            dataSource: remoteCities,&lt;br /&gt;            schema: {&lt;br /&gt;                resultFields: [&amp;#39;name&amp;#39;]&lt;br /&gt;            },&lt;br /&gt;            matchKey: &amp;#39;name&amp;#39;,&lt;br /&gt;            delimChar: &amp;#39;,&amp;#39;,&lt;br /&gt;            typeAhead: true,&lt;br /&gt;            contentBox: &amp;#39;#&amp;lt;portlet:namespace /&amp;gt;drop-down-2&amp;#39;&lt;br /&gt;        }&lt;br /&gt;    ).render();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    autocomplete.generateRequest = function(query) {&lt;br /&gt;        return {&lt;br /&gt;            request: &amp;#39;&amp;amp;q=&amp;#39; + query&lt;br /&gt;        };&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    autocomplete.render();&lt;br /&gt;&lt;br /&gt;&amp;lt;/aui:script&amp;gt;</summary>
    <dc:creator>Henry K</dc:creator>
    <dc:date>2010-12-07T19:34:52Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6153978" />
    <author>
      <name>Thomas Berg</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6153978</id>
    <updated>2010-10-14T13:54:45Z</updated>
    <published>2010-10-14T13:54:45Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hello Jelmer,&lt;br&gt;&lt;br&gt;Sorry for wasting your time, as it turned out, it wasn't working in Firefox either... Due to the fact that I mixed up which server was currently running!&lt;br&gt;&lt;br&gt;I have one 6.0.5 server and one 6.0.10. On the latter I escape all URLS by default so by adding&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;var dataSource = new A.DataSource.IO(
    {
        source: '&amp;lt;portlet:resourceurl [color="#1F22E6]escapeXml=&amp;amp;quot;false&amp;amp;quot;[/color]" /&amp;gt;'
    }
);&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;It works in both IE and Firefox...&lt;br&gt;&lt;br&gt;Thanks again&lt;br&gt;&lt;br&gt;Regards Thomas&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Thomas Berg</dc:creator>
    <dc:date>2010-10-14T13:54:45Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6145696" />
    <author>
      <name>Jelmer Kuperus</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6145696</id>
    <updated>2010-10-13T21:16:58Z</updated>
    <published>2010-10-13T21:16:58Z</published>
    <summary type="html">tested it with liferay 6.0.5 on ie 8.0.7600.16385 on windows 7 and i do not have this problem&lt;br /&gt;&lt;br /&gt;oh and the missing semi colon is actually not a bug as it is allowed per spec&lt;br /&gt;&lt;br /&gt;http://bclary.com/2004/11/07/#a-7.9</summary>
    <dc:creator>Jelmer Kuperus</dc:creator>
    <dc:date>2010-10-13T21:16:58Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6138582" />
    <author>
      <name>Thomas Berg</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6138582</id>
    <updated>2010-10-13T09:00:42Z</updated>
    <published>2010-10-13T09:00:42Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Thanks Jelmer! Got the missing piece (defining a datasource)!&lt;br&gt;&lt;br&gt;Your example works in Firefox but I I cannot get it to work correctly in IE8. When searching, the warning symbol is displayed (see attached image). &lt;br&gt;&lt;br&gt;I noticed that there's a semicolon (;) missing in view.jsp and thought that might be the reason but it makes no difference:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;autocomplete.generateRequest = function(query) {
    return {
        request: '&amp;amp;amp;q=' + query
    };
}[color=#F31919];[/color]&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Thomas Berg</dc:creator>
    <dc:date>2010-10-13T09:00:42Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6086604" />
    <author>
      <name>Corné Aussems</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6086604</id>
    <updated>2010-10-07T07:21:23Z</updated>
    <published>2010-10-07T07:21:23Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Thanks for your help again Jelmer;&lt;br&gt;&lt;br&gt;My problem was as stupid as ever;&lt;br&gt;&lt;pre&gt;&lt;code&gt; resultListLocator: "list", &lt;/code&gt;&lt;/pre&gt;&lt;br&gt;I didn't understand that i had to wrap my JsonArray into a JsonObject mapped with the key 'list'.&lt;br&gt;&lt;br&gt;Cheers&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Corné Aussems</dc:creator>
    <dc:date>2010-10-07T07:21:23Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6084057" />
    <author>
      <name>Jelmer Kuperus</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6084057</id>
    <updated>2010-10-07T00:27:35Z</updated>
    <published>2010-10-07T00:27:35Z</published>
    <summary type="html">I was playing around with this tonight. attached you will find an example portlet that demonstrates the use of the AutoComplete component.&lt;br /&gt;&lt;br /&gt;it includes both a plain javascript and ajax example.&lt;br /&gt;&lt;br /&gt;I hope this helps</summary>
    <dc:creator>Jelmer Kuperus</dc:creator>
    <dc:date>2010-10-07T00:27:35Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6075414" />
    <author>
      <name>Corné Aussems</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6075414</id>
    <updated>2010-10-06T09:33:08Z</updated>
    <published>2010-10-06T09:33:08Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Just some more considerations it &lt;strong&gt;must &lt;/strong&gt;be the &lt;strong&gt;json &lt;/strong&gt;data that is bugging me because a simple dataset is working fine;&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;window.AC = new A.AutoComplete( 
        { 
            dataSource: function(request) { 
                var items = null; 
				var urlS = '&amp;lt;portlet:resourceurl id="search" /&amp;gt;'+'&amp;amp;amp;search='+A.one('#&amp;lt;portlet:namespace /&amp;gt;searchwords').get('value');
                A.io.request(urlS, { 
                    cache: true, 
                    sync: true, 
                    timeout: 1000, 
                    method: 'get', 
                    on: { 
                        success: function() { 
                            items =  eval(this.get('responseData')); // the evil eval 
                        }, 
                        failure: function() { 
                        } 
                    } 
                }); 

                return items; 
            }, 
            dataSourceType: 'Function', 
			schema: {
				resultFields: ['name']
			}, 
            matchKey: 'name',
            delimChar: '',
            typeAhead: true, 
            contentBox: '#myContainer',
            input: '#&amp;lt;portlet:namespace /&amp;gt;searchwords'            

        } 
    ); 
    AC.render();
&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Corné Aussems</dc:creator>
    <dc:date>2010-10-06T09:33:08Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6071179" />
    <author>
      <name>Corné Aussems</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6071179</id>
    <updated>2010-10-05T21:53:05Z</updated>
    <published>2010-10-05T21:53:05Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi all,&lt;br&gt;I managed to get the ajax call return this JSON string [{"id":"1","name":"testname 1"},{"id":"2","name":"testname 2"}] but i get a yellow Icon and no autocomplete. &lt;br&gt;&lt;br&gt;Could someone help me out here?&lt;br&gt;&lt;pre&gt;&lt;code&gt;
&amp;lt;div id="myContainer"&amp;gt;
  &amp;lt;aui:input name="searchField" value="" /&amp;gt;
&amp;lt;/div&amp;gt;



&amp;lt;aui:script use="aui-dialog,liferay-portlet-url"&amp;gt;
AUI().use('aui-autocomplete', function(A) {
    window.AC = new A.AutoComplete( 
        { 
            dataSource: function(request) { 
                var items = null; 
 		var urlS = '&amp;lt;portlet:resourceurl id="search" /&amp;gt;'+'&amp;amp;amp;search='+A.one('#&amp;lt;portlet:namespace /&amp;gt;searchField').get('value');
                A.io.request(urlS, { 
                    cache: true, 
                    sync: true, 
                    timeout: 1000, 
                    dataType: 'json', 
                    method: 'get', 
                    on: { 
                        success: function() { 
                            items = this.get('responseData'); 
                        }, 
                        failure: function() { 
                        } 
                    } 
                }); 

                return items; 
            }, 
            dataSourceType: 'Function', 
            schema: { 
                metaFields: {javaClass:"javaClass"}, 
                resultListLocator: "list", 
                resultFields: ['id', 'name'] 
            }, 
            schemaType: 'json', 
            forceSelection: true, 
            autoHighlight: false, 
            matchKey: 'id', 
            queryDelay: 0.5, 
            typeAhead: true, 
            contentBox: '#myContainer', 
            input: '#&amp;lt;portlet:namespace /&amp;gt;searchField' 
        } 
    ); 

    AC.resultTypeList = false; 
    AC.formatResult = function(oResultData, sQuery, sResultMatch) { 
        return ('&amp;lt;span style="color:#191970;"&amp;gt;' + sResultMatch + "&amp;lt;/span&amp;gt;, " + oResultData.name); 
    }; 

    AC.render();
});
&amp;lt;/aui:script&amp;gt; 

&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
	public void serveResource(ResourceRequest request, ResourceResponse response) throws IOException, PortletException {
try {
	String searchFor = ParamUtil.getString(request, "search");
			
	JSONArray jsonResult = com.liferay.portal.kernel.json.JSONFactoryUtil.createJSONArray();
				
	JSONObject jsonRow = com.liferay.portal.kernel.json.JSONFactoryUtil.createJSONObject();
		jsonRow.put("id", "1");
		jsonRow.put("name", "testname 1");
		jsonResult.put(jsonRow);

	JSONObject jsonRow2 = com.liferay.portal.kernel.json.JSONFactoryUtil.createJSONObject();
		jsonRow2.put("id", "2");
		jsonRow2.put("name", "testname 2");
		jsonResult.put(jsonRow2);

				
	_log.debug("serveResource() jsonResult.toString()="+ jsonResult.toString());
				
				response.getWriter().append(jsonResult.toString());

			} catch (Exception e) {
				e.printStackTrace();
			}

		super.serveResource(request, response);
	}
&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Corné Aussems</dc:creator>
    <dc:date>2010-10-05T21:53:05Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6036655" />
    <author>
      <name>Tanweer Ahmed .</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6036655</id>
    <updated>2022-06-11T18:01:40Z</updated>
    <published>2010-10-01T13:41:43Z</published>
    <summary type="html">THnx Scott , &lt;br /&gt;&lt;br /&gt;Sooper...</summary>
    <dc:creator>Tanweer Ahmed .</dc:creator>
    <dc:date>2010-10-01T13:41:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=5991484" />
    <author>
      <name>Henk Schipper</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=5991484</id>
    <updated>2010-09-27T13:50:44Z</updated>
    <published>2010-09-27T13:50:44Z</published>
    <summary type="html">@Scott&lt;br /&gt;&lt;br /&gt;Please don&amp;#39;t understand me wrong, but I am still getting a bit used to alloy. What should be the correct code when using a datasource in ajax. I tried several things and I know my servlet is working (excuse the language) to retrieve the words/products, and my ajax call is correct, because I see my data which is being transfered, but the last part. I cannot get the data in the autocomplete field.&lt;br /&gt;&lt;br /&gt;I used the example of Thomas. But please extend the source.&lt;br /&gt;&lt;br /&gt;Henk</summary>
    <dc:creator>Henk Schipper</dc:creator>
    <dc:date>2010-09-27T13:50:44Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=5969244" />
    <author>
      <name>Scott Lee</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=5969244</id>
    <updated>2010-09-24T01:51:11Z</updated>
    <published>2010-09-24T01:51:11Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;to hook it onto an input text field, just add the "input: '#&amp;lt;portlet:namespace/&amp;gt;to" option like Thomas had posted.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;div id="&amp;lt;portlet:namespace /&amp;gt;autoCompleteContainer"&amp;gt;
	&amp;lt;aui:input name="to" value="&amp;lt;%= to %&amp;gt;" /&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;Hope that helps&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Scott Lee</dc:creator>
    <dc:date>2010-09-24T01:51:11Z</dc:date>
  </entry>
  <entry>
    <title>RE: AUI - Need AutoComplete example that fetches json data through ajax/sja</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=5426412" />
    <author>
      <name>Tanweer Ahmed .</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=5426412</id>
    <updated>2022-06-11T18:01:40Z</updated>
    <published>2010-07-27T17:00:12Z</published>
    <summary type="html">Hello every1,&lt;br /&gt;&lt;br /&gt;Still waiting for the implemented code....</summary>
    <dc:creator>Tanweer Ahmed .</dc:creator>
    <dc:date>2010-07-27T17:00:12Z</dc:date>
  </entry>
</feed>
