From a125906cec32d645597ca3373cf0584c5251435e Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Fri, 21 Feb 2025 11:14:10 +0200 Subject: [PATCH] Avoid obsolete filter syncing That appears to be obsolete as the filter is anyways sent to the @ClientCallable method when the filtering should actually be done. --- .../vaadin/flow/component/combobox/ComboBoxBase.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vaadin-combo-box-flow-parent/vaadin-combo-box-flow/src/main/java/com/vaadin/flow/component/combobox/ComboBoxBase.java b/vaadin-combo-box-flow-parent/vaadin-combo-box-flow/src/main/java/com/vaadin/flow/component/combobox/ComboBoxBase.java index 543ed094d9d..f32ddf8ec67 100644 --- a/vaadin-combo-box-flow-parent/vaadin-combo-box-flow/src/main/java/com/vaadin/flow/component/combobox/ComboBoxBase.java +++ b/vaadin-combo-box-flow-parent/vaadin-combo-box-flow/src/main/java/com/vaadin/flow/component/combobox/ComboBoxBase.java @@ -102,6 +102,8 @@ public abstract class ComboBoxBase>, HasTheme, HasValidationProperties, HasValidator, HasPlaceholder { + private String lastKnownFilter; + /** * Registration for custom value listeners that disallows entering custom * values as soon as there are no more listeners for the custom value event @@ -345,9 +347,8 @@ public void setAllowCustomValue(boolean allowCustomValue) { * * @return the filter string */ - @Synchronize(property = "filter", value = "filter-changed") protected String getFilter() { - return getElement().getProperty("filter"); + return lastKnownFilter; } /** @@ -358,7 +359,11 @@ protected String getFilter() { * @param filter * the String value to set */ + @Deprecated protected void setFilter(String filter) { + lastKnownFilter = filter; + // MT 20250-02-21 I assume client side never uses this, probably the + // whole method is obsolete getElement().setProperty("filter", filter == null ? "" : filter); } @@ -1344,6 +1349,7 @@ private void confirmUpdate(int id) { */ @ClientCallable private void setRequestedRange(int start, int length, String filter) { + this.lastKnownFilter = filter; dataController.setRequestedRange(start, length, filter); }