Skip to content
Snippets Groups Projects
Commit 149de484 authored by buczekp's avatar buczekp
Browse files

[LMS-1216] improved column filter reset performance; fixed system tests

SVN: 12829
parent 9144bdc4
No related branches found
No related tags found
No related merge requests found
...@@ -165,25 +165,29 @@ public class FilterToolbar<T> extends ToolBar implements IDatabaseModificationOb ...@@ -165,25 +165,29 @@ public class FilterToolbar<T> extends ToolBar implements IDatabaseModificationOb
private void updateFilterFields() private void updateFilterFields()
{ {
filterContainer.removeAll();
Filter filter = filterSelectionWidget.tryGetSelected(); Filter filter = filterSelectionWidget.tryGetSelected();
if (isColumnFilterSelected()) if (filter != null)
{ {
for (PagingColumnFilter<T> filterWidget : columnFilters) filterContainer.removeAll();
if (isColumnFilterSelected())
{ {
filterContainer.add(filterWidget); for (PagingColumnFilter<T> filterWidget : columnFilters)
} {
applyTool.hide(); filterContainer.add(filterWidget);
} else }
{ applyTool.hide();
for (String parameter : filter.getParameters()) } else
{ {
filterContainer.add(new CustomFilterParameterWidget(parameter)); for (String parameter : filter.getParameters())
{
filterContainer.add(new CustomFilterParameterWidget(parameter));
}
applyTool.show();
updateApplyToolEnabledState();
} }
applyTool.show(); // don't show reset button if there are no fields to reset
updateApplyToolEnabledState(); resetTool.setVisible(filterContainer.getItemCount() > 0);
} }
resetTool.setVisible(filterContainer.getItemCount() > 0);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
...@@ -194,7 +198,9 @@ public class FilterToolbar<T> extends ToolBar implements IDatabaseModificationOb ...@@ -194,7 +198,9 @@ public class FilterToolbar<T> extends ToolBar implements IDatabaseModificationOb
if (field instanceof Field) if (field instanceof Field)
{ {
Field f = (Field) field; Field f = (Field) field;
f.reset(); // Simple 'f.reset()' causes automatic filter application,
// but we want to reload data only once after all filters are cleared.
f.setRawValue("");
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment