From 0611c0202a7e0084e998be4f82d1c1a5ca89aaca Mon Sep 17 00:00:00 2001 From: Bauke Scholtz Date: Thu, 5 Sep 2024 12:13:45 -0400 Subject: [PATCH] Fix #39 --- .../omnifaces/optimusfaces/model/LazyPagedDataModel.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/omnifaces/optimusfaces/model/LazyPagedDataModel.java b/src/main/java/org/omnifaces/optimusfaces/model/LazyPagedDataModel.java index dd7528b..5852bc4 100644 --- a/src/main/java/org/omnifaces/optimusfaces/model/LazyPagedDataModel.java +++ b/src/main/java/org/omnifaces/optimusfaces/model/LazyPagedDataModel.java @@ -289,7 +289,7 @@ protected LinkedHashMap processFilters(FacesContext context, Dat for (UIColumn column : processableColumns) { var field = column.getField(); - Object value = getFilterValue(filterBy, field); + var value = getFilterValue(filterBy, field); if (isEmpty(value)) { value = getTrimmedQueryParameters(context, getFilterParameterName(context, table, field)); @@ -313,7 +313,7 @@ protected List processSelectionIfNecessary(FacesContext context, List curr } protected String processGlobalFilter(FacesContext context, DataTable table, Map filterBy) { - var globalFilter = getFilterValue(filterBy, GLOBAL_FILTER); + var globalFilter = (String) getFilterValue(filterBy, GLOBAL_FILTER); if (globalFilter != null) { globalFilter = globalFilter.trim(); @@ -326,9 +326,9 @@ protected String processGlobalFilter(FacesContext context, DataTable table, Map< return isEmpty(globalFilter) ? null : globalFilter; } - private static String getFilterValue(Map filterBy, String field) { + private static Object getFilterValue(Map filterBy, String field) { var filterMeta = filterBy.get(field); - return filterMeta == null ? null : (String) filterMeta.getFilterValue(); + return filterMeta == null ? null : filterMeta.getFilterValue(); } private String getFilterParameterName(FacesContext context, DataTable table, String field) {