Filter Parameter of Category not filtered to a specific entity

When building a new filter which has a parameter of Category, there is no way to specify which entity you are selecting from. This leads to the drop down list of categories containing categories from all entities. I would like to suggest the ability to filter out the available categories based on the entity. I imagine this would look similar to the dialog that is presented when adding a dynamic attribute as a parameter when you are prompted to specify the category.

I’ve also experienced this issue. Seems like it would be a pretty simple fix, to filter this control to only categories on the entity. Any chance this is addressed?

This seems like a fix that would be easy to implement. Is there no answer to why Categories on the filter control don’t filter to the entity you’re working with for that parameter?

Is there any update on this? We have received no response as of yet and this is still a major issue for us.

You can create a custom condition for the category where items in the dropdown list are filtered by any criteria you want.

The custom condition in the filter XML should look like this:

        <filter id="filter"
                applyTo="authorsTable"
                dataLoader="authorsDl">
            <properties include=".*" excludeProperties="category"/>
            <custom name="myCategory"
                    caption="msg://myCategory"
                    paramClass="com.haulmont.cuba.core.entity.Category"
                    paramWhere="{E}.entityType = 'sample_Author'">
                    {E}.category.id = ?
            </custom>
        </filter>

Only categories for the sample_Author entity will be in a dropdown list.

Thank you for the reply! I believe this solves our issue.