Customising genericFilter

Dear Support

Attached you find a small project

  • there is a table with collections
  • there is a table with objects which have to belong to a collection
  1. In the Filter I want to use an entityComboBox instead of the entityPicker
  2. The create button is only active, if there is a collection selected in the Filter
  3. When a new object is created, the selected collection from the Filter has to be inserted in the object
  4. In Add Search condition the text of the fields are shown from messages_[lang]. How to change this text from the controller ?

Filter.zip (1.0 MB)

Thank you for any advice

Felix

Hi Felix!

You can configure the generated components for the generic filter using the following application property:
https://docs.jmix.io/jmix/flow-ui/ui-properties.html#jmix.ui.component.entity-field-fqn


Use enabledRule install point to provide a predicate for enabling the createButton. To get a value from the propertyFilter, you can read the following topic:


You can define an initializer for createAction:
image


Do I understand correctly that you mean changing the property labels in the dialog for adding a new filter condition?

If so, it is impossible to do it from the controller. One way is to override the io.jmix.flowui.action.genericfilter.GenericFilterAddConditionAction action and change the localized label for the filterConditions that are set there.

Best regards,
Dmitriy

Hi @d.kremnev

Thank you a lot for your detailled answer !

1./3./4. is resolved ( did detect a lot of nice features :wink:

  1. I did try to implement the onGenericFilterConfigurationRefresh. This event does not get fired if I just change a value (autoApply = true ) and I did not find another event to hookup ?

Best regards

Felix

Attached the adapted project
Filter.zip (1.0 MB)

Hi Felix!

The event is fired successfully, I was able to get into the method body using a breakpoint.

image

However, to get your component you need to use the objIdCollection property, not the collection.
Also, I have implemented a mechanist to control the availability of the Create button. Please see the attached project.

Filter.zip (1.0 MB)

Best regards,
Dmitriy