im using this code to filter based in which checkbox is selected,
positiveFilter= RowFilters.regexFilter(0, "^pos", columnStatus);
neutralFilter = RowFilters.regexFilter(0, "^neu", columnStatus);
negativeFilter = RowFilters.regexFilter(0, "^neg", columnStatus);
according to the selected checkbox, it add the filter to the List
filters = new ArrayList<RowFilter<TableModel, Object>>();
so i set the filters to one Filter
RowFilter<TableModel, Object> compoundRowFilter = rowFilter.orFilter(filters);
and then: jxTable.setRowFilter(compoundRowFilter); //im using JXTable
the problem now is that i need to filter the results based on the date TOO,
HERE I GET the date between the 2 selected dates, and than add to the filter, so it will check for the row Text if it starts/match
filtersData = new ArrayList<RowFilter<TableModel, Object>>();
dates = new ArrayList<LocalDate>();
for (Date data : obtenerFechasDiariasIntervalo(jxdatainicial.getDate(), jxdatafinal.getDate())) {
filtersData.add(RowFilters.regexFilter(0, "^" + longFormat.format(data) + "", 5));
}
but its impossible to use both filters together i think
like:
compoundRowFilter = RowFilter.orFilter(filtersData).orFilter(filters);
if i use this above, it return me all the results based on the checkbox
if i use the andFilter(filters); it stop working when i select more than one checkbox...
ps: im trying to avoid a new query to the database to use a specific daterange method
since the data is not all the time changed i dont need to check everytime..
BUT i think this is only the real way =\