drop-down filter for string or numeric or any other field in non-related entity

I am trying to get a search field over string attribute, as it is not possible by using generic filter because there is no automated drop down list for string or numeric or any other field available so I thought to use a LookupPickupField but this is not so helpful either.
Is there any other way possible to get a drop down filter for string or numeric field?
Thanking in advance.


you’re right at the moment generic filter component doesn’t allow you to fill lookups with custom values set. If you need to filter data by some string or integer propety and want to have the values in the dropdown list that is filled manually, then you can create a custom filter.

Take a look at this sample project: https://github.com/gorbunkov/sample-custom-filter

In the books browse screen there is a custom filter. Values for lookups are populated in the screen controller.

You can read more about query filters that were used in the example here: https://doc.cuba-platform.com/manual-6.4/datasource_query_filter.html

Hi Max,
Thank you for the sample project. I was trying to follow the same, in my project one of the entity extends “BaseIdentityIdEntity” so in the screen controller when I @inject collectiondatasource it gives me an error saying “type parameter is not within its bound; should implement com.haulmount.core.entity.Entity” so I changed my entity to extends “StandardEntity” instead of “BaseIdentityIdEntity” and the error disappear but when I try to run the application I got another error (attached screenshot).
I am also attaching screenshots of the screen controller and the entity file.
Please help me.





mapping-browse screen controller

I am still looking for the answer.

At first glance, I don’t see any error.

Try to clean the project (in the Studio there is a menu item Build - Clean). Then drop the existing tomcat - in the Studio press the Alt + </i> combination and in the search window type the dropTomcat - Studio will offer to execute this gradle task. Then run the project.

If the error doesn’t disappear, then create a sample project that reproduces the problem with one entity and its screens and attach it here.