O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

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

Providing completion suggestions using the AutoComplete component

The AutoComplete component provides a list of matching suggestions based on what you have already typed in the input field. This enables the user to quickly select available options without the need of completely typing the value.

In our TechBuzz application, we will use the <p:autoComplete> component in the Search Users screen. In the Search Users screen, we can search other users by their e-mail IDs. By using the AutoComplete component, we will display a list of e-mail IDs that start with what the user typed in the input field, by using the following code:

<p:autoComplete value="#{userController.searchEmail}" completeMethod="#{userController.completeEmail}"/>

The AutoComplete component ...

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