I successfully display data using autocomplete, I share all data using the delimiter ','.
Now I have a requirement to implement automatic completion, for example Liferay Tags for fields, as shown below:

below is my code:
<aui:script>
AUI().use('autocomplete-list', 'aui-base', 'aui-io-request', 'autocomplete-filters', 'autocomplete-highlighters',
function (A) {
A.io.request('<%=getEntities%>',{
dataType: 'json',
method: 'GET',
on: {
success: function(event, id, obj) {
try {
new A.AutoCompleteList({
allowBrowserAutocomplete: 'false',
activateFirstItem: 'true',
inputNode: '#<portlet:namespace />entitiesNames',
resultTextLocator: 'entityName',
render: 'true',
resultHighlighter: 'phraseMatch',
resultFilters:['phraseMatch'],
maxResults: 10,
queryDelimiter : ',',
source:this.get('responseData'),
autoLoad:false,
});
} catch(e) {
alert('not working sudheer: ' + e);
}
}
}
});
});
</aui:script>
Also posted on the Liferay forum: https://www.liferay.com/community/forums/-/message_boards/message/47095147
source
share