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

b:datatable per-column filtering only returns matches in all columns #433

Closed
susanne69 opened this issue Jun 22, 2016 · 19 comments
Closed
Assignees
Labels
Milestone

Comments

@susanne69
Copy link

Hi,
I am using Bundle-Version: 0.8.6, Bundle-Date: 20160522-21:44:31.
Entering a filter value in an individual column returns only rows where the value is found in all columns per row.
Example:
firstname lastname
John Dow

If I enter 'o' it returns the row but 'dow' the row disappears.

Is this possible to fix?

Bootsfaces is great :)

@zhedar
Copy link
Collaborator

zhedar commented Jun 22, 2016

I currently can't seem to be able to reproduce this. The Showcase example (the second) seems to work fine. Does it work for you as well?

Maybe you can provide a small example for us to reproduce.

Edit: Right after submitting this, I figured you meant the multi-column-search feature, which isn't working. I couldn't test this yet.

@susanne69
Copy link
Author

That's a quick response!
I forgot to say that multi-column-search should be true. multi-column-search="true" creates the filter fields for each column.

What I understood is a specific column is filtered. There is now Showcase for this on your page. They all have multi-column-search not set so basically default value false.

You just need to have one row, my previous example col1: John and col2: Dow.
Enter dow in the second column and the filter will exclude the row.

Thanks for having a look at this.

@stephanrauh stephanrauh self-assigned this Jun 22, 2016
@stephanrauh stephanrauh added this to the v0.9.0 milestone Jun 22, 2016
@stephanrauh
Copy link
Collaborator

That's the same bug I've encountered this evening. Currently, it puzzles me. The source code we generate looks precisely as the working demo at https://datatables.net/examples/api/multi_filter.html.

BTW, after your nice words about BootsFaces we simply have to solve the bug for you! :)

@susanne69
Copy link
Author

I feel honoured :)
Thank you!

@stephanrauh
Copy link
Collaborator

More precisely, the search seems to match rows that have the input in every read-only cell. Input fields are ignored.

@susanne69
Copy link
Author

susanne69 commented Jun 22, 2016

Even worse than I thought ;) Then it's worth fixing it!
I will stop using it like a chat :)

@stephanrauh
Copy link
Collaborator

Oh, and I just started to enjoy our nice little chat :). Anyway, I finally managed to wrap my head around it. For some reason, we registered a key listener to every input field in every column. That sounds good, but it was implemented as a double for loop, which means we've registered 25 listeners for a table consisting of five columns. Strange bug - especially because it seems to be the same source code as in the documentation.

My current solution is not good, but it'll do for the moment.

@stephanrauh
Copy link
Collaborator

Just in case you want to test the bug fix: I've pushed a new version of BootsFaces 0.9.0-SNAPSHOT to Maven Central. See #369 on how to get it.

@stephanrauh
Copy link
Collaborator

To dos left:

  • get the multi-search feature in the header up and running
  • replace the current version by a version that also works if there are both footer and header search fields
  • add an option to suppress multi-search on a per-column-basis
  • document it.

@susanne69
Copy link
Author

I have tried working with BootsFaces 0.9.0-SNAPSHOT and Maven to be prepared when it is fixed :)
I used the same source code but the per-column filter fields do not show up when setting multi-column-search="true".

@zhedar
Copy link
Collaborator

zhedar commented Jun 24, 2016

Hey,
als of 0.9 you also need to set searching="true". Maybe that helps.

Am 24.06.2016 um 17:55 schrieb susanne69 [email protected]:

I have tried working with BootsFaces 0.9.0-SNAPSHOT and Maven to be prepared when it is fixed :)
I used the same source code but the per-column filter fields do not show up when setting multi-column-search="true".


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@susanne69
Copy link
Author

I have tried searching="true" and searching="false".
multi-column-search="true" does not seem to have an effect.
The the per-column filter fields do not want to cooperate.

@stephanrauh
Copy link
Collaborator

Nasty fields :). Have a look at http://www3.bootsfaces.net/Showcase/forms/DataTable.jsf (sourcecode at https://github.com/TheCoder4eu/BootsFacesWeb/blob/master/src/main/webapp/forms/DataTable.xhtml). The second demo allows you to switch searching and multi-column-searching on. The table is reloaded on-the-fly by an AJAX request. Hope that helps!

@susanne69
Copy link
Author

My genius his hiding at the moment ... I am sure it will surprise me later when I am done with digesting ;).
I do not get it. Which build are you using in your Showcase. When I switch the searching value only the general search input appears or disappears. The per-column filter fields have vacation right now. I cannot see anything wrong in my code. Do you set multi-column-search-position in your Showcase what values would it take? Is multi-column-search dependent on it? Which build are you using in your Showcase?

@susanne69
Copy link
Author

OK. The values of multi-column-search I found, it says with a spelling mistake botton "'top','botton', and 'both'. Default to 'bottom'". ... and set it to something. Look my genius turned up again:
Voilà,! It works. You need to pay me for this :)
It just does not default to anything!

@susanne69
Copy link
Author

... and it works even filtering in the specific column. My John Dow appears now. I meant to call him John Doe but I was so touched by the difficult times of Jones Dow ;)

Thanks you for solving this.

Shall we keep the default value for multi-column-search-position to be solved within this issue?

@stephanrauh
Copy link
Collaborator

Jones Dow :)

@stephanrauh
Copy link
Collaborator

Let's close this ticket and open a new ticket for search buttons above the table.

@susanne69 THX for your help! I've deactivated the option - I hope that helps other developers avoid the trap I've let you run into. I'm going to publish another developer snapshot to Maven Central in a couple of moments.

@stephanrauh
Copy link
Collaborator

I've uploaded the snapshot and opened a follow-up ticket (#436).

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