Jump to content
We've recently updated our Privacy Statement, available here ×

Jasper Server 8.0.0 Custom Input Controls not Working - jQuery not loading


nafiesa.allie
Go to solution Solved by Yuriy Plakosh,

Recommended Posts

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:1

I 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

  • 2 weeks later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

No references to 3rd party libraries in the global scope

Starting 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 instead

In JSP where your JavaScript code is, replace:

jQuery(document).on("controls:initialized", function(event, controlsViewModel) {[/code]

with

document.addEventListener("controls:initialized", function(event, others) {        var controlsViewModel = event.detail;[/code]
Link to comment
Share on other sites

  • 2 months later...
  • Solution

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...