-
Notifications
You must be signed in to change notification settings - Fork 101
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
rescue dataTable properties #409
Comments
Whow! Sounds like a good idea. Let's collect a list of properties to be saved:
Anything else? |
yes, the filter field should also be added btw. you added this to v1.0.0 as milestone; I need this feature a bit earlier. How about a new branch on current stable release 0.8.6 to add this changes? |
Currently the team's time is sparse, therefore we cannot promise to deliver a fast implementation, but if you want to try this yourself, we could also get this into 0.9.0 . |
@jottyfan I'd love to implement your feature in 0.9.0, but chances are we publish this version this weekend. That means it's too risky to add a major feature in such a time frame. What we can talk about, is publishing another intermediate version before 1.0. But I doubt you need the feature that fast: 1.0 is due just before the JavaOne conference. Even so, you could start with the developer preview. And, like @zhedar said, you can speed up thing be sending us a pull request. Interested? Best regards, |
Ok, I didn't know about your release plans. In this case, I'd be very glad to have this extension added in a 0.9.X branch, maybe in a snapshot version. I'll try to find a way to implement this on the 0.9.0 branch as soon as I can find some time. If it works the way I hope, I will make a pull request here. |
Doing so (as mentioned), I'm stuck on generating the ajax call to bind the table's configuration variables to the bean. This is the point where I think one of you developers could help me with an example for understanding bootsfaces ajax. What I have is: ...
if (propertyBean != null) {
rw.writeText("table.on('drawCallback', function(settings){" +
" updateDatatableProperties(table, settings);" +
"});", null);
}
//# End enclosure
rw.writeText("} );", null );
rw.endElement("script"); Now that I need is the implementation of updateDatatableProperties to update the propertyBean with values from settings. This would be done by bootsfaces ajax, but I've got too less understanding. propertyBean is an instance of ADataTablePropertyBean: public abstract class ADataTablePropertyBean {
private Integer pageLength;
private Integer currentPage;
private String searchTerm;
private String orderString;
public ADataTablePropertyBean(Integer pageLength, Integer currentPage, String searchTerm, String orderString) {
this.pageLength = pageLength;
this.currentPage = currentPage;
this.searchTerm = searchTerm;
this.orderString = orderString;
}
+ getter/setter
} The javascript function drawCallback is given by https://datatables.net/reference/option/drawCallback itself, and I suggest settings to contain the current values we're interested of. I'd like to push my current developement state, but github doesn't allow me to create a new branch, I get this error: git-receive-pack not permitted. Seems that I have not enough rights for that... |
As for the branch: create your own branch by clicking on the "fork" button at the top of this page. This creates a copy of BootsFaces in your own repository, and you've got full write access (because it is your own repository). |
The The second part is to read the value of the hidden field on the server. This is done in the |
So I created a fork, the new repo is now available on https://github.com/jottyfan/BootsFaces-OSP and all changes are done in branch datatableoptions. I wonder how you will be able to get the changes back to your base repo, but this may be one of the next steps when all changes are included. Thanks for your hint about the fork, I didn't know that. |
@jottyfan Getting the changes back, as in merging, happens via Pull Requests. |
ok, so when I'm finished in developement, I merge my branch to my forked master. Then, I do a pull request to the fork source? |
Actually the pull request already does a merge tiself, so you don't have to do that before. It's also possible to open a PR before you finished everything, it will get us the possibility to review your changes and discuss them, so you don't have to wait for your last adjustments to open one, if you push to a branch you opened a PR on, it will also be added to the PR. |
Ok, that's easier, nice. How can I mark my pull request to be a "do not yet pull, just watch it" request? I don't want this code to be included into the main branch until it is good enough... If I just pull the branch, who gives me a guarantee not to merge this? |
It should suffice to put it into the description, then edit it out and comment again, when you're done. Atleast that's what I did.
You probably shouldn't have to worry, no one will merge a PR without having a closer look at it. |
ok, created a pull request |
again one question if you look at the pull request, you can find a comment in DataTableRenderer's encodeBegin method in line 133 - this is where I put the hidden input field for storing the javascript values. Now this question is simple: how do I implement a <f:ajax /> call for my dataTable.onUpdateProperyBean here? I'm convinced there is an elegant solution, but I'm still not familiar enough with this. Maybe you have another example for me? |
this feature is still being integrated in the main branch, therefore I close this issue. |
On paginated datatables, whenever the page is reloaded, all options of pagination and ordering get lost. This is weird, as when you work with a table and have to leave the page for another issue, you have to fiddle the old options again when you come back.
How about an attribute to the dataTable tag that keeps all current dataTable options? This could be a java bean so that all options may be made persistent by jsf itself. The update of the java bean could be done automatically by every change in java script (using ajax of course). I'd need such a feature and could implement it myself, but I wonder if it would be possible to do that in a common way so that this could get back to the master branch...
Let me give you an example of my understanding of this idea:
MyBean must be an implementation of IDataTableProperty (could also be an abstract class):
And on every javascript change of the table's display nature, in
could be bound an ajax call to update myBean.
The benefit would be that I could just take myBean, put it into my session and make it persistent if I want to keep it alive over sessions (for example as json object into a postgreSQL db).
The text was updated successfully, but these errors were encountered: