How to modify filter components?

Is there a way to modify components used for Filter conditions? Something like FieldGroup generators or at least get them in postinit hook?
If no, I would like to work on a PR for this if somebody sometime point me how it should be done.


can you elaborate a little bit on what you mean by “Filter components”? Are you talking about the UI components that are used in the Filter CUBA component? Are you talking about the dialog windows that open when you add a filter condition? Or do you mean after selecting a particular attribute the resulting filter UI component to display the filter condition for this attribute?

Perhaps it is something that is already possible, but it needs some more clarification :slight_smile:


Hi, Mario. The third - inputs for selecting parameter’s value.



For now, the only way to modify these components is to override the com.haulmont.cuba.gui.components.filter.Param class. It is a Spring bean with prototype scope. So, in your web-spring.xml replace the Param bean with your own implementation:

<bean id="cuba_FilterParam" class="" scope="prototype"/>

In your Param implementation override the required method (createTextField, createDateField and so on).

Also, can you please explain in what cases do you want to replace the components and what do you want to use instead?


The same cases we have withFieldGroup - polish the app, e.g. change lookup screen open type, replace some selects with radio buttons (our users are used to such behaviour from previous systems). It isn’t a show stopper of course, but a nice feature to have.

Hi, currently we are working on FieldGroup API redesign and we will change a lot of things including new pluggable FieldFactory. See:

1 Like