« Back

Comma separated multiple Autocomplete in one field

General Blogs June 4, 2014 By Sushil Patidar

As there are lot more improvements in the Alloy UI 2.X . Some attributes have been removed and some are replaced for auto complete. So to implement the comma separeted multiple autocomplete in one field in Alloy UI 1.5 there was attribute delimChar: ','   that have been replaced with queryDelimiter : ','   

In Liferay 6.2 this functionality can be achieved by using the following AUI script.

 

 

<aui:input name="states" type="textarea" ></aui:input>

 

<aui:script use="autocomplete-list,aui-base,autocomplete-filters,autocomplete-highlighters">
 
   var states = [
           {"name":"California"},
           {"name":"Colorado"},
           {"name":"Connecticut"},
           {"name":"Colorado"}
           ]; 
   new A.AutoCompleteList(
       {
        allowBrowserAutocomplete: 'false',
        activateFirstItem: 'true',
        inputNode: '#<portlet:namespace/>states',
        resultTextLocator: 'name',
        resultHighlighter:'phraseMatch',
        resultFilters: ['startsWith'],
        minQueryLength: 2,
        maxResults: 10,
        queryDelimiter : ',',
        render: 'true',
        source:states
   });  
</aui:script>
 
Threaded Replies Author Date
Hi Sushil, I was looking for this in one of... Ahmed Hasan June 5, 2014 5:18 AM
HI .. How to eliminate duplicate item here Mohammad Azharuddin February 18, 2015 11:36 PM

Hi Sushil,

I was looking for this in one of the current projects and you exactly gave the solutions. Thank you so much.

Ahamed Hasan
Author, Liferay Cookbook
http://mpowerglobal.com/download-cookbook
Posted on 6/5/14 5:18 AM.
HI .. How to eliminate duplicate item here
Posted on 2/18/15 11:36 PM.