LookupType in filter

Using @Lookup(type = LookupType.SCREEN) (in order to display hierarchical lookup entity) doesn’t work in Filter.
Maybe I’m doing something wrong? I’ve tried to include everything in view and create nested datasources, but nothing works.

Looks like a problem with ConditionParamBuilderImpl$PropertyParameterInstantiationStrategy#getParamBuilder line 97:

MetaProperty metaProperty = condition.getDatasource().getMetaClass().getProperty(condition.getName());

It returns null, so when checking whether LookupType.SCREEN is set, platform returns false because there’s no info. I’ve managed to get it work by replacing getProperty with getPropertyPath and getMetaProperty:

MetaProperty metaProperty = condition.getDatasource().getMetaClass().getPropertyPath(condition.getName()).getMetaProperty();

Cuba 6.4.1

Could you provide more details on your case? The part of your data model, filter condition, etc.

I’ve made a repo on github with a sample. There’re 3 entities:

  • Patient - has Diagnosis and Sibling
  • Sibling - has Diagnosis
  • Diagnosis - is an entity for diagnoses lookup table

Everything is ok if filter patients by diagnosis, but lookup widget is wrong when you filter by sibling’s diagnosis.


Hi Kirill,

Thank you very much for the clear explanation, test project and proposed solution. However, it took a while for me to understand why the problem didn’t appear in your project - I didn’t notice the overridden bean with your fix in the first place :slight_smile:

Your fix will go to the next bug-fix release - see the linked issue.

No problem, thank you. Description of the question was too much complicated.
I have another one about Fitler and hierarchical dictionaries, so maybe you would look at it? Thx u again.

:ticket: See the following issue in our bug tracker: