Error in filter having dynamic attributes

Hi !

A table for an entity (Batch) has a filter that includes dynamic attributes for one of its properties (Substance), i.e. the dynamic field is not part of the batch entity but belongs to the child Substance entitiy.

Once the filter is created, it works as expected and search is ok. But, if we close that window and open it again, we receive the following message when the filter is applied. Any ideas ?

We are running CUBA version: 7.2.15

Hi, any way to troubleshoot/solve this problem ?

Thanks !!

Hi,

It looks like a bug. I’ve created an issue.

As a temporary workaround you may override the FilterDelegateImpl bean in your project (web module):

import com.haulmont.cuba.gui.components.filter.FilterDelegateImpl;
import com.haulmont.cuba.gui.components.filter.condition.AbstractCondition;
import com.haulmont.cuba.gui.components.filter.condition.DynamicAttributesCondition;

public class MyFilterDelegateImpl extends FilterDelegateImpl {

    @Override
    protected boolean suitableCondition(AbstractCondition condition) {
        if (condition instanceof DynamicAttributesCondition) {
            return true;
        } else {
            return super.suitableCondition(condition);
        }
    }
}

and register the bean in web-spring.xml:

<bean id="cuba_FilterDelegate" class="com.company.sample.web.filter.MyFilterDelegateImpl" scope="prototype"/>

Thanks for taking it ! I’ll try the workaround.