Problem PropertiesFiler

I custom a PropertyFilter version 2

protected PropertyFilter<String> createAgePropertyFilter() {
    PropertyFilter<String> agePropertyFilter = uiComponents.create(PropertyFilter.class);
    agePropertyFilter.setConditionModificationDelegated(true);
    agePropertyFilter.setDataLoader(usersDl);
    agePropertyFilter.setProperty("username");
    agePropertyFilter.setOperation(PropertyFilter.Operation.CONTAINS);
    agePropertyFilter.setOperationEditable(true);
   agePropertyFilter.setAutoApply(true);
    agePropertyFilter.setParameterName(PropertyConditionUtils.generateParameterName(
            agePropertyFilter.getProperty()));
    agePropertyFilter.setValueComponent(singleFilterSupport.generateValueComponent(
            usersDl.getContainer().getEntityMetaClass(),
            agePropertyFilter.getProperty(),
            agePropertyFilter.getOperation()
    ));
    return agePropertyFilter;
}

I create a CustomView extend StandardView, has a VerticalLayout and add PropertyFilter into Layout

VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.add(createAgePropertyFilter());
customView.add(verticalLayout);

But when i type into Input in Property, i don’t receive result from filter
Screenshot 2024-04-05 091750

1 Like

Hi Thang,

You must set value to “false” at setConditionModificationDelegated
for example: agePropertyFilter.setConditionModificationDelegated(false);

But i have another problem when i set like that, i recevied a
java.lang.NullPointerException: Cannot invoke “String.startsWith(String)” because “paramName” is null

Hi Thang,

Do you sure enable this code?: agePropertyFilter.setParameterName(PropertyConditionUtils.generateParameterName(
agePropertyFilter.getProperty()));

1 Like