-
Notifications
You must be signed in to change notification settings - Fork 66
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
fix: Ensure that GridListDataView#setFilter fires DataChangeEvent #5304
base: main
Are you sure you want to change the base?
Conversation
Sonatype Lift is retiringSonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
I think this is a rather opinionated change, and personally I would not agree with it. The purpose of the As such, I'll close this PR and related issue. As for alternatives, for an application, which sets the filter in the first place, it should also be possible to do some other thing as part of the same step rather than adding some indirection via an event of the grid. Other than that, maybe the data view should fire an event if the viewed data changes. |
Firing a |
I re-opened the PR based @mshabarov conclusion. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@@ -4663,7 +4663,8 @@ private void onInMemoryFilterOrSortingChange( | |||
updateInMemorySorting(sortComparator); | |||
updateInMemoryFiltering(filter); | |||
|
|||
dataCommunicator.reset(); | |||
// Call refreshAll as data may have changed due filter change | |||
getDataProvider().refreshAll(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to move refreshAll()
from here to the data view.
Then the setFilter
on the Flow side will be like this:
@Override
public AbstractListDataView<T> setFilter(SerializablePredicate<T> filter) {
DataViewUtils.setComponentFilter(component, filter);
fireFilteringOrSortingChangeEvent(filter,
(SerializableComparator<T>) DataViewUtils
.getComponentSortComparator(component).orElse(null));
refreshAll();
return this;
}
This would fix all similar issues in data view, not only the Grid.
Same issue is raised here #5465. |
But this PR is valid. We need to get rid of extra reset call in the Grid in the end. |
Quality Gate passedIssues Measures |
Fixes #5303