-
Notifications
You must be signed in to change notification settings - Fork 102
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
Add AJAX to b:dateTimePicker #482
Comments
Done and documented with 9e9b7e0 . Maybe @stephanrauh you must have a look to check is all ok, please! |
I guess I should run a QA session on it, but it's definitely far better than before. The remaining issue is that the demo loses the time of the date picker. @asterd AFAIK, you cared about it, but I also remember you didn't push your solution to GitHub? |
Using 0.9.2, I can't seem to get ajax to do anything at all. Was this tested? |
Hi @MitchTalmadge, the source code on GitHub was aligned with the support of Ajax in DateTimePicker (9e9b7e0 and 3532a41). I don't know if the pre-build jar contains this commit... but also in BootsfacesWeb (source code) the documentation is aligned with an example of ajax call. |
@asterd It appears that ajax does work for popup and basic type fields, but not at all for inline. Also, the ajax appears to only fire when I click on the field, but not when I click on the dates inside the popup. For example, if I click on the field, which makes the popup appear, then ajax is fired. If I click a date inside the popup, even though the date changes inside the field, ajax is not fired. If I click away from the field, and then click on it again, ajax is now fired and the correct date is sent. I understand that much of this might be the fault of the datetimepicker library creator. I'll see if there's any documentation there... Edit: Actually, it works perfectly fine on their site: http://eonasdan.github.io/bootstrap-datetimepicker/ (See the linked pickers example)... The bootsfaces code looks fine though, so I'm confused. |
Found the problem; ajax is only happening on the Edit: Even with this method, the inline datepicker does not work w/ ajax. The value being set is always null, no matter what. Edit: I've determined that the reason for the problem with the inline datepicker is that the library never sets the value of the input field created by BootsFaces. In the example on https://eonasdan.github.io/bootstrap-datetimepicker/, there is actually no input field at all, hidden or otherwise. Javascript may be required to set the value properly Edit: I was able to solve the problem with this javascript: ondtchange="javascript:$('#searchByTimeForm\\:startTimePicker_Input').val(event.date.format('MM/DD/YYYY h:mm a'));ajax:true" on So, the best solution would be to create similar javascript automatically... I will give it a go. Edit: oops, you guys are ahead of me a bit. I just found this code: if("inline".equals(mode)) {
rw.writeText("$('" + fullSelector + "').on('dp.change', function(e) { " +
" $('#" + BsfUtils.escapeJQuerySpecialCharsInSelector(clientId) + "').val( e.date.format(" + displayFormat + ") ); " +
"});", null); But obviously it isn't working. I will try to fix it. Edit: Easy fix: the id of the input field was not correct. See the PR below. |
@MitchTalmadge thanks for your PR! |
@stephanrauh , I guess the PR solved the Issue? Or there was something left? |
As @ScreamingTree86 points out, we've forgotten to add AJAX to
<b:dateTimePicker />
. BootsFaces 1.0 should fix that.The text was updated successfully, but these errors were encountered: