ComboBox filter problem

Hi everybody,
with Vaadin 6.8.3 and later, I noticed a problem in ComboBox: The filter does not work. When typing something into the combo I always get a blank dropdown list.

The problem is solved downgrading to Vaadin 6.8.2

This is the code I used:


myCombo = new ComboBox("MyCaption");
myCombo.setDescription("Seleziona un Cliente");
myCombo.setContainerDataSource(myApplication.getInstance().getDbHelp().getMyContainer());
myCombo.setItemCaptionPropertyId("myField");
myCombo.setFilteringMode(Filtering.FILTERINGMODE_CONTAINS);
myCombo.setImmediate(true);
myCombo.setWidth("100.0%");
myCombo.setHeight("-1px");
myCombo.addListener(new Property.ValueChangeListener() {
    public void valueChange(ValueChangeEvent event) {
        if (myCombo.getValue() != null) {
            ...
        }
    }
}

Is it a bug or something changed in new releases?? Please help!

Thinking it’s a bug I opened a ticket here:

http://dev.vaadin.com/ticket/10103

I cannot upgrade to newer releases without losing combobox filter… Typing something on the combo make it drop down an empty list…

The combobox filter does not work properly since Vaadin 6.8.3

Please help!

Works fine for me in 6.8.5. What sort of container are you using?

I’m using SQLContainer:


public SQLContainer getmyContainer() {
	if(myContainer==null) {
		try {
			FreeformQuery q = new FreeformQuery("SELECT * FROM mytable ", connectionPool);
			myFreeformQueryDelegate myDelegate = new myFreeformQueryDelegate();
			// filters
			List<Filter> filters = new ArrayList<Filter>();
			filters.add(new Equal("Pfx", "C"));
			myDelegate.setFilters(filters);
			q.setDelegate(myDelegate);
			myContainer = new SQLContainer(q);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	return myContainer;
}

However, downgrading to Vaadin 6.8.2 it works properly… :frowning:

Not familiar with SQLContainer, sorry… Hopefully someone else will chime in.

Same behavior for me : also using a combobox with sqlcontainer datasource.

Does anybody has any tip ?

Regards

Not sure but this might help in figuring it out:

If a combo box is configured for the item property display mode, it adds and removes filters to the container dynamically. In that case, the problem could be related to your implementation of FreeformQueryDelegate.

If another mode is used or there are other reasons why the above does not work, filtering is performed in memory on the server.

In either case, putting breakpoints in ComboBox.getOptionsWithFilter(boolean) and ComboBox.getFilteredOptions() and tracing from there might help find the cause.

With Vaadin 6.8.5 I tried using TableQuery instead of FreeformQuery and I get that the dropdown list is not empty and it’s correctly filtered, but when clicking on an item the valueChange listener is not called if it’s the first item. Strange behaviour… :frowning:

Any idea or workaround for solving this? Thanks

I created a ticket with a small demo application for demonstrating this problem


http://dev.vaadin.com/ticket/10471

That bug was fixed, but now there is another one: sometimes Combo.getItem() returns null.

Downgrading to Vaadin 6.8.2 it works properly… :frowning:

Please fix the ComboBox