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

Allow to order a table with a data-order attribute #622

Closed
vdelacerda opened this issue Jan 20, 2017 · 8 comments
Closed

Allow to order a table with a data-order attribute #622

vdelacerda opened this issue Jan 20, 2017 · 8 comments
Assignees
Milestone

Comments

@vdelacerda
Copy link
Contributor

datables.net has a data-order attribute to order a table by any value despites the cell value.

<td data-order="1311552000">Mon 25th Jul 11</td>

Just add

String dataOrder = (String) column.getAttributes().get("dataOrder");
if (dataOrder != null && !dataOrder.isEmpty()) {
    rw.writeAttribute("data-order", dataOrder, null);
}

to add this enhancement, I have a pull request to this.

@stephanrauh
Copy link
Collaborator

stephanrauh commented Jan 20, 2017

Thanks! There are just to todos left:

  • document the new feature in the showcase
  • add the property to the BootsFaces.jsfdsl file.

@stephanrauh stephanrauh self-assigned this Jan 20, 2017
@stephanrauh stephanrauh added this to the v1.1.0 milestone Jan 20, 2017
@stephanrauh
Copy link
Collaborator

stephanrauh commented Jan 20, 2017

Documentation and the entry in the JSFDSL file were already there. It seems the generator plugin has a bug.

@vdelacerda
Copy link
Contributor Author

May I have to add the feature in the showcase ? If so, what is the project ?

@stephanrauh
Copy link
Collaborator

Your help is welcome, but in this particular case you've discovered a bug that isn't quite the bug it seems to be. As it turns out, we've implemented the data-order attribute some time ago. I don't know what your source code looks like, but currently my IDE even shows an error because you've added a variable that's already there. I don't believe you've submitted such a buggy source code, so it's obvious something weird is going on. We use a plugin to generate most of the JSF components. This plugin has run into trouble some time ago. I don't know for sure, but I suspect the reason is that we've got so many JSF components that the plugin has become to slow. Be that as it may, the plugin starts over and over without ever finishing. This may be the reason why the entries in the *.jsfdsl file never made it into the component and the taglib.

I've removed the plugin from the build-on-save list and added a context menu instead. Now it seems to work. Even if it doesn't: now it's easier to find bugs in the plugin.

If you're interested in using the plugin, here it is: https://github.com/stephanrauh/JSFLibraryGenerator/tree/master/plugins

Now to your original question. The documentation (aka showcase) is here: https://github.com/TheCoder4eu/BootsFacesWeb. Like BootsFaces-OSP, this is a hybrid project supporting both Maven and Gradle.

stephanrauh added a commit that referenced this issue Jan 20, 2017
stephanrauh added a commit that referenced this issue Jan 20, 2017
stephanrauh added a commit that referenced this issue Jan 20, 2017
@stephanrauh
Copy link
Collaborator

The root cause of the generator problem was a directory that already existed with a difference case.

@stephanrauh
Copy link
Collaborator

@vdelacerda I've just uploaded a new version of BootsFaces-1.1.0-SNAPSHOT to Maven Central. See #369 on how to get it. Please run a quick check if your issue has been solved.

The showcase demonstrates the feature at http://www3.bootsfaces.net/Showcase/forms/DataTable.jsf. Scroll to "customizing the table". The column "age" is displayed as a string but sorted numerically. A few lines below I've explained the feature. Feel free to give us feedback if there's something to improve.

Thanks! Both for contributing a pull request and for nudging me to fix my IDE setup!
Stephan

@vdelacerda
Copy link
Contributor Author

Great, @stephanrauh it's OK ! I switched my forked BootsFaces into the original 1.1.0 in my project, I have the data-order feature.
Thanks for your responsiveness.
I'm using BootsFaces for a long time support project so surely see you soon.

@stephanrauh
Copy link
Collaborator

BootsFaces is a long-term project, too, so it's a good match :).

A tout a l'heur
Stephan

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

No branches or pull requests

2 participants