nafiesa.allie Posted December 31, 2021 Share Posted December 31, 2021 Jasper Server 8.0.0 does not seem to load jQuery at all. This results in my custom tabs and input controls not showing on the input dialogue.When in F12 Console, I type in at the prompt: if (jQuery && typeof jQuery !== "undefined") { console.log(jQuery.fn.jquery); }the result is:VM868:1 Uncaught ReferenceError: jQuery is not defined at eval (eval at <anonymous> (flow.html:1), <anonymous>:1:1) at <anonymous>:1:1I have tested this on various pages, e.g. when the input dialogue is displayed, the schedule, etc. jQuery just does not load.How do I get around this issue? I have a very strict timeline in which to get those custom tabs and input controls to work. I am using the Community Edition.The custom .jsp files were used were placed in this location apache-tomcat-10.0.14webappsjasperserverWEB-INFjspmodulesinputControls. Link to comment Share on other sites More sharing options...
Yuriy Plakosh Posted January 11, 2022 Share Posted January 11, 2022 No references to 3rd party libraries in the global scopeStarting JRS 8.0.0 the libraries used by JRS will not be exposed to the global scope. Because of that, an attempt to use jQuery from the global scope will not work unless jQuery is added to the global scope by your custom code.Use DOM API insteadIn JSP where your JavaScript code is, replace:jQuery(document).on("controls:initialized", function(event, controlsViewModel) {[/code]withdocument.addEventListener("controls:initialized", function(event, others) { var controlsViewModel = event.detail;[/code] Link to comment Share on other sites More sharing options...
ken.freeman Posted March 30, 2022 Share Posted March 30, 2022 I also need this. Switching to "vanilla.js" is not a workable option for me; my custom pages use libraries that depend on jQuery. Link to comment Share on other sites More sharing options...
Solution Yuriy Plakosh Posted March 31, 2022 Solution Share Posted March 31, 2022 If you need jQuery just include it in your JSP with a script tag like<script src="${pageContext.request.contextPath}/scripts/jquery.js"></script>[/code]If you need it for multiple pages you can include it in decoratorMinimalImports.jsp You also need to place your own copy of jquery.js into your scripts folder. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now