Skip to content

Avoid obsolete filter syncing #7135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ public abstract class ComboBoxBase<TComponent extends ComboBoxBase<TComponent, T
HasListDataView<TItem, ComboBoxListDataView<TItem>>, HasTheme,
HasValidationProperties, HasValidator<TValue>, 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
Expand Down Expand Up @@ -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;
}

/**
Expand All @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down