Get filter conditions in the screen controller


I need to get the filter conditions in the controller screen as a jpql query, because I need these conditions for a service.

Someone can help me?



I think you can use “load delegate” method for your purposes from here: Data Loaders - CUBA Platform. Developer’s Manual

Loaders can delegate actual loading to a function which can be provided using the setLoadDelegate() method or declaratively using the @Install annotation in the screen controller, for example:

Loader delegate method accepts LoadContext as parameter. LoadContext contains JPQL query and parameters. In delegate method you can implement your custom logic how to load data based on query.


Hi Alex,

Thanks for the reply, but I can’t update the cuba version until attachable add-on upgrade. I’m using cuba platform 6.10.9 version.

Well, in this case you can create your own subclass of the CollectionDatasourceImpl class.
Then override the method.
Copy most of logic from it. Replace just this line with your own logic:

final Collection entities = dataSupplier.loadList(context);