COMBOBOX - Hide popup suggestions


I use a vaadin combobox on my page. I want :

  • hide popup suggestions when the filter string length is under 2 characters
  • show popup suggestions when filter string length is less then 3 characters.

I tried to use the function “setPageLength(0);” but I see a empty popup :frowning:
Help me please, how can I hide popup suggestion ? a example ?

p.s : sorry, my english is so rusty :cry:

You can override
buildFilter(String, FilteringMode)
method - just return
is shorter than 2 characters.

I tried but it’s wrong : the popup is always display (
even when filteringString is shorter than 2 characters
how the method “changeVariables(Object source, Map<String, Object> variables)” work ?
other ideas ?

my code

properties of my combobox :


the method override :

    protected Filter buildFilter(final String filterString, FilteringMode filteringMode)
        if (StringUtils.length(filterString) < 2)
            return null;

            return new Filter() {

                public boolean passesFilter(Object itemId, Item item)
                        throws UnsupportedOperationException

                    // my comparaison (return true or false)

                public boolean appliesToProperty(Object propertyId)
                    return true;

What do you mean by “popup suggestion”? If you don’t want to see combobox items return the filter, that returns
when the string length is smaller than 2.


Thanks for you post. I attach a screenshot to see you my problem.
When my filter returns false for all suggestions, I can see a empty popup (see. screenshot)
How can I hide this popup ?

You can’t - this is the combobox looks like. Probably you need a diffrent component, take a look at