FilteringTable
FilteringTable copied to clipboard
Adding filters seems to be affecting multiple users on different computers and browsers
Adding filters seems to be affecting multiple users on different computers and browsers We are seeing filters that one person adds on one computer affect filters that other people are seeing on other computers and browsers. Sometimes the data will be completely filtered out and not updating.
Are you sure you are using it correctly? Please show some code
The application has been running ok for years. It was deployed to a Wildfly fail-over server (3 servers in fail-over mode) plus there have been some Chrome updates. Chrome is the most-used browser to access it. Below is the main code for the table:
`public class MainScreen extends VerticalLayout {
private FilterTable filterTable;
public MainScreen() {
super();
this.addStyleName("phonedir");
this.setMargin(new MarginInfo(true, true, false, true));
this.setSpacing(true);
HorizontalLayout topBar = new HorizontalLayout();
topBar.setSpacing(true);
BeanItemContainer<EAMInventory> data = VaadinDB.getInstance().data;
filterTable = new FilterTable();
filterTable.setContainerDataSource(data);
filterTable.setWidth("100%");
filterTable.setVisibleColumns("part_no", "pt_desc", "location", "manuf_part_no", "manuf_code", "curr_qty", "uom",
"reord_pt", "mgt_goal", "on_order", "vendor_no", "vendor_name", "buyer", "catalog", "sub_catalog", "type_code");
filterTable.setColumnHeaders("Part #", "Description", "Location", "Manufacturer Part #", "Manufacturer", "On Hand", "UOM",
"Reorder Pt", "Mgt Max Qty", "On Order", "Supplier #", "Supplier Name",
"Buyer", "Catalog", "Sub Catalog", "Part Type");
Object[] sortProperties = {"part_no"};
boolean[] sortAscendingProperties = {true};
filterTable.sort(sortProperties, sortAscendingProperties);
filterTable.setFilterGenerator(new InventoryValueFilterGenerator());
filterTable.setFilterBarVisible(true);
filterTable.setImmediate(true);
filterTable.setRowHeaderMode(CustomTable.RowHeaderMode.HIDDEN);
filterTable.setColumnCollapsingAllowed(true);
filterTable.setColumnReorderingAllowed(true);
Button clearFilters = new Button("Clear all filters");
clearFilters.addClickListener(new Button.ClickListener() {
@Override
public void buttonClick(Button.ClickEvent clickEvent) {
filterTable.clearFilters();
filterTable.resetFilters();
}
});
clearFilters.addStyleName(ValoTheme.BUTTON_PRIMARY);
topBar.addComponent(clearFilters);
Label filterInstructions = new Label("Filter by entering the string you'd like to search for in the text box underneath the column header.");
filterInstructions.addStyleName(ValoTheme.LABEL_LARGE);
topBar.addComponent(filterInstructions);
this.addComponent(topBar);
this.addComponent(filterTable);
}
`