Skip to content
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

Table UI does not respect previous filters #9

Open
eugener opened this issue Jul 8, 2012 · 2 comments
Open

Table UI does not respect previous filters #9

eugener opened this issue Jul 8, 2012 · 2 comments
Assignees
Labels

Comments

@eugener
Copy link
Owner

eugener commented Jul 8, 2012

More info at http://code.google.com/p/oxbow/issues/detail?id=44

@ghost ghost assigned eugener Jul 8, 2012
@ThePumpingLemma
Copy link
Contributor

This feature looks like a pain to implement. For example, let's say the UI does respect previous filters by reading the possible values from the table instead of the model. If I initially open the filter popup and see:

[x] All
[x] Item1
[x] Item2
[x] Item3

If I select "Item2" and apply it, subsequent views of the filter will show:

[x] All
[x] Item2

Since the filter popup would only show values that actually appear in the filtered table, there is no way to reselect "Item1" or "Item3" unless all of the filters are reset. This is especially bad if you want to retain a number of filters that you already have applied to other columns.

In order for this to work, you would need a view of the table that does not contain any filters for the current column you wish to display the filter popup for. Easiest way would be to allow the popup to access all of the previous applied filters, take the subset of filters that are not applied to the popup's column, and manually filter the table with the filter subset (as opposed to using JTable's getValueAt() method). At a minimum, the JTableFilter will have to be reworked since the filters are currently composed in a recursive manner (i.e. the only way to remove a filter is to clear them all). The bigger problem is that the actual filtering mechanism is implementation dependent and doesn't necessarily map well between implementations (e.g. the JTableFilter composes RowFilters whereas a GlazedLists-based table would use FilterLists), so it may be difficult to map it back to a simple API to use within filtering GUI.

Additionally, the distinct item caching mechanism would need to be reworked or removed since the cache would need to be reset every time a filter is applied or unapplied. Personally, I have a feeling that the caching cannot be reworked since their isn't a full-proof way to listen to the table for filtering changes (e.g. listening for JTable filtering changes vs. JXTable filtering changes vs. GlazedLists filtering changes).

I think it is technically feasible, but I think a good chunk of the code needs to be redesigned to accommodate this request.

@muelli1000
Copy link

Has this issue been resolved yet? I am looking for a smart solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants