Primefaces : How to change to the autocomplete component isn’t case sensitive?

Check your implementation driven by “completeMethod”. In this implementation you should perform the dealings só that this query isn’t case sensitive.

First Example, change your matches:


{...} />

public List<Pessoa> filterPlaces(final String filtro) {
    return getPlace().stream()
            .filter(f -> StringUtils.containsIgnoreCase(f.getName(), filtro.trim()))

Second Example, change your query:

public List<Place> filterByName(String name) {
    Criteria criteria = getSession().createCriteria(Place.class);
    criteria.add("name", name).ignoreCase());
    return criteria.list();

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s