Filtering composite entities

Can a filter component be added to a child table in a composite relationship exists? In other words, Can I add a filter component to the Orders table on my Customer editor screen?

I am trying but I keep getting an error when I try to add a search condition.


java.lang.NullPointerException: query is null
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:228)
	at com.haulmont.cuba.core.sys.jpql.QueryTreeAnalyzer.prepare(QueryTreeAnalyzer.java:50)
	at com.haulmont.cuba.core.sys.jpql.QueryTreeAnalyzer.prepare(QueryTreeAnalyzer.java:46)
	at com.haulmont.cuba.core.global.QueryParserAstBased.getQueryAnalyzer(QueryParserAstBased.java:78)
	at com.haulmont.cuba.core.global.QueryParserAstBased.getEntityAlias(QueryParserAstBased.java:119)
...

I assigned the table to the filter attribute (applyTo) and the nested datasource to the filter attribute (datasource). I would just like confirmation if this is not possible before I spend any more time on it. Thanks.

Hi,

i think it is not possible to use the filter component with nested datasources.

But it will work if you make your nested datasource a first level datasource with a where condition to met your outer datasource context (like "where e.customer = …).

Here’s actually an example in the docs that does exactly this:

https://doc.cuba-platform.com/manual-6.6/manual.html#qs_customer_edit_with_orders

Bye
Mario

Thanks. I appreciate it.