How do you use the filter component to filter for entities with fields that are NULL or unset?

I have an entity with a field that references another entity and I want to filter for values that are NULL (unset). I can create a filter component with a combo box but If I select the “blank” item in the list then the filter component it treats it as removing that field from from the where clause. How do I filter for NULL values?

I am using JMix 1.4

Thank you

Use the “is set” operation with “No” value.
For example:

image

I get it. Thank you for your quick response.

My PropertyFilter uses an EntityComboBox as follows:

                            <propertyFilter id="filterConfig1A_type1_Id" caption="type1" operation="EQUAL" property="type1_Id" operationEditable="true">
                                <entityComboBox metaClass="ampata_GenNodeType"/>
                            </propertyFilter>

I noticed that when the screen is running and I change the comparator from EQUAL to IS_SET and then back to EQUAL, the PropertyFilter switches from EntityComboBox to EntityPicker.

Is there a way to keep the PropertyFilter switching from EntityComboBox to EntityPicker?

I’d recommend setting the jmix.ui.component.entity-field-type for your entity:

jmix.ui.component.entity-field-type.ampata_GenNodeType = entityComboBox

Then filter will always use entityComboBox for selecting this entity, without explicit setting of a component in propertyFilter condition.

1 Like