-
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
'moment is not defined' when using DateTimePicker in sub page with Primefaces #958
Comments
Most likely it's not the fault of PrimeFaces (although PrimeFaces has a feature addressing exactly that problem). When you JSF page is initially rendered, it doesn't know it's going to contain a Currently, the recommended solution is to add a hidden Does this solve your problem? Please report back so we can close the ticket (and answer the question on StackOverflow). |
Hey, thanks! Adding a hidden Seeing as PrimeFaces does contain a feature that addresses this, would it make sense to include a similar feature for BootsFaces components like this? |
It seems the feature has already been implemented in JSF 2.3: |
Summarizing what @tandraschko told me:
Cutting a long story short: IMHO we should continue investigating the topic, but it's unlikely it will make it into BootsFaces 1.3.0. |
Ich dont think that point 2 is correct. The API should support all cases, i just said that it doesnt work in MyFaces currently. |
@tandraschko Thanks! My sloppy choice of words :). I've updated the point. |
Fixed and tested with BootsFaces on MyFaces, will be included in 2.3.2. So it should work on every JSF version when PF6.0+ is included, also it works fine if you use JSF2.3 without PF6.0+. |
Let's close the issue. Anybody who need the feature can either add PrimeFaces or migrate to JSF 2.3 (or above). |
Overview
There's currently a bug using Bootsfaces in combination with PrimeFaces when using modules like DateTimePicker in a subpage. Whenever an ajax request is done to change a content to a different sub-page, You then end up with an error in the JS console:
jQuery.Deferred exception: moment is not defined @[url]/:1:235 j@[url]/javax.faces.resource/jquery/jquery.js.xhtml?ln=primefaces&v=6.2:2:29997 g/</k<@[url]/jquery/jquery.js.xhtml?ln=primefaces&v=6.2:2:30313 jquery.js.xhtml:2:31569
ReferenceError: moment is not defined
It seems like that this happens in connection with Primefaces as the error exception mentions the jQuery resource from Primefaces itself.
Reproducing the error
Other resources
It's probably a longer standing bug as there's a StackOverflow question where an user had a similar issue with that. He managed to fix this by manually loading his own moment.js and DateTimePicker.js files.
Link: https://stackoverflow.com/questions/39620172/using-bootsfaces-datetimepicker
Using
The text was updated successfully, but these errors were encountered: