jpqlFilter custom filter field

I need a predefined jpqlFilter that supports a custom component like the propertyFilter. It is unclear to me if this is supported or not. And if not, how to solve this?

The question is similar to that of Custom filter field although there the focus is on the jmix.ui.component.entity-field-type property.

I’m looking for something like

        <filter id="filter" dataLoader="dossiersDl">
            <properties excludeProperties="id, version,createTs,createdBy,updateTs,updatedBy,deleteTs,deletedBy"
                        include=".*"/>
            <conditions>
                <jpqlFilter caption="msg://filter_broker" parameterClass="eu.octorilla.contact.model.Company">
                    <condition>
                        <c:jpql>
                            <c:join>join {E}.parties brokerParty join brokerParty.company broker</c:join>
                            <c:where>brokerParty.role = 'BROKER' and broker.id = ?</c:where>
                        </c:jpql>
                        <entityComboBox metaClass="octo_Company" optionsContainer="brokerCandidatesDc">
                            <actions>
                                <action id="lookup" type="entity_lookup"/>
                                <action id="clear" type="entity_clear"/>
                            </actions>
                        </entityComboBox>
                    </condition>
                </jpqlFilter>
            </conditions>
        </filter>

More specifically Im looking for

  1. The option to specify the used component and actions
  2. being able to specify the optionsContainer

Jmix version: 1.5.4
Jmix Studio plugin version: 2.1.1-233
IntelliJ version: IntelliJ IDEA 2023.3 (Ultimate Edition)

1 Like

Hi Tom!

I tried to use a custom component for the JPQL filter, but failed. It’s strange that in the case of the property filter everything works fine. For some reason, the JPQL filter ignores the custom component for custom condition case only.

For now, the only way to get the behaviour you want is to implement your own filter configuration.

I created an issue to solve this problem: JPQL Filter ignores the value component for the custom condition case · Issue #2661 · jmix-framework/jmix · GitHub

Regards,
Dmitriy