O'Reilly logo

Liferay User Interface Development by Frank Yu, Xinsheng Chen, Jonas X. Yuan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Other Alloy UI features

In the sample Snippet portlet, there is also other code that shows different Alloy UI features. These features are commonly used in web applications.

Auto-complete

People are most familiar with this feature at a search engine site. Now in Alloy UI, its code is simple.

<div id="autoComplete"></div>
// ignore details
AUI().use('aui-autocomplete', function(A) {
var states = [
['AL', 'Alabama', 'The Heart of Dixie'],
// ignore details
['WY', 'Wyoming', 'Like No Place on Earth']
];
var anAc = new A.AutoComplete({
dataSource: states,
schema: {
resultFields: ['key', 'name', 'description']
},
matchKey: 'name',
delimChar: ',',
typeAhead: true,
contentBox: '#autoComplete'
}).render();

The states variable is a two-dimensional array. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required