How to locate the javascript files in XReports-modules

I am currently working on this issue 1. XReports Module 2. XREP-6 and am currently trying to locate the javascript files to validate the form but all in vain. I have tried opening several files of javascript i cant get the files i really want. Could anyone advise me on how to do away with this

I thought when i tried to inspect the page i would be able track the javascript file with the source code which somehow looks similar to the one on the inspected page though i wasn’t able to get to see what i wanted . Can anyone help me on how i can easily resolve this! @dkayiwa @jwnasambu @sharif @reagan @herbert24

@ndacyayisenga Where did you search for the Javascript files?

I suspect you may have to look into the gsp’s themselves .

Did you take a look at this https://wiki.openmrs.org/display/docs/XReports+Module+ReportDesigner+Technical+Overview

@dkayiwa does he have to manipulate the JS files ?

just looked at your ticket,it rquires working with a web service,rest api.You could first read on how to use the rest api for openmrs so that you get to know on how to use the GET and the POST

@tendomart i tried to check on the gsps but there isnt anything that would lead to the production of the this page

yea i did look at this https://wiki.openmrs.org/display/docs/XReports+Module+ReportDesigner+Technical+Overview @dkayiwa

@herbert24 could this be in the .java source code not the .jsp???

have you tried to checkout on the web service documentation for rest api just to see how the GET and Post methods are used?

[quote=“ndacyayisenga, post:5, topic:28409”] @tendomart i tried to check on the gsps but there isnt anything that would lead to the production of the this page [/quote]https://talk.openmrs.org/uploads/default/original/2X/4/40e09340856a8a24fc258624a01efa1961e13a56.png

@ndacyayisenga don’t you think the screen “Inspection Element” sometimes looks different from the original source code.(especially not pre-compiled) have you used SDK or you’re checking from standalone as your image suggests.?

and it looks like some JS files are pre-compiled JS .

Let’s wait and see if @dkayiwa will clear the mystery.

@herbert24 i tried to check man but its either i got a misconception or something is wrong because i din’t find help…

@tendomart man am checking from standalone as the image suggests… How would you check from the SDK???

@ndacyayisenga For the record: When you what to check for scripts/stylesheets of a site via chrome dev tools, you should select the sources tab rather than the element tab… Will try to check up on your issue shortly

So @ndacyayisenga I have had a quick look at your issue and I think these are the things to think about.

  1. Currently the validation errors are coming from the controller and not any javascript file that you are trying to look for.
  2. The issue about name not being null is being thrown at this line
  3. The error thrown when display order is passed as a string instead of number is thrown here

Now coming back to what the ticket expects from you.

  • Your task is to add a javascript file to validate the form before submitting it to avoid those errors from thrown by the controller.

Nice coding…

@reagan Thanks so much … my eyes are now open :grinning:

1 Like