Hey, I wanted to implement this add-on in my Code. But I am struggling wit

Hey,

I wanted to implement this add-on in my Code.
But I am struggling with the Filter.
Could you go more into detail how I am supposed to build the TextFilterField class?

Thank you.

Best wishes,
Nicola

Hi Nicola, let me see if I can help you.

In order to create filters, you need a filter class extending AbstractCompositeField (or any field class that implements HasValueAndElement interface) and a dto class that extends FilterFieldDto. The main thing about this filter class is that there you can define what is going to be shown in the filter popup.

In the demo, TextFilterField is define to filter string values using a TextField (we also added some options for the filter value as checkboxes, but you can add just a TextField or whatever you want).
So for this demo example, the dto class should have a filterValue string. And in the same class, you need to define the predicate that is going to be use for filtering using the method
getFilterPredicate().

In case you need to filter a non-string value, for example a date, you can define something like a DateFilterField with the filter field being a DatePicker and a DateFieldFilterDto with the filterValue being a LocalDate.

[Here]
(https://github.com/vaadin-component-factory/enhanced-grid-flow/blob/main/enhanced-grid-flow-demo/src/main/java/com/vaadin/componentfactory/enhancedgrid/filtering/TextFilterField.java) you can see how TextFilterField is implemented and [ here]
(https://github.com/vaadin-component-factory/enhanced-grid-flow/blob/main/enhanced-grid-flow-demo/src/main/java/com/vaadin/componentfactory/enhancedgrid/filtering/TextFieldFilterDto.java) is TextFieldFilterDto.

Hope this helps!

Hey Paola,

thank you very much, that was exactly what I was looking for.

Best wishes,
Nicola