Adding the JS File in ondemandJSfiles.xml File

After registering the app, add the app JS class files in the ondemandJSfiles.xml file. All the files referenced within the ondemandJSfiles.xml file will be monitored for any type of content modification. The modifications will be rendered on refresh or re-login without the need of restarting the application server.

If suppose you have created the application project development setup using Canvas codegen JARs, then the on-demand XML file name shall be <application name>ScriptConfig.xml instead of ondemandJSfiles.xml. Hence, ensure to update the correct XML file for configuring the on-demand loading of JS files for your application.

To load certain JS files for the whole application, use the CT_READY as the fileset id in the ondemandjsfiles.xml file. For example,

<JsFiles>    
    <fileset id ="CT_READY"  preserveOrder = "Y">
		<file url ="/javascript/canvas.modelhouse.headerfooter.js"/>
	</fileset>
</JsFiles>


To load specific JS files when a particular Workspace in the application is clicked, use the WSPACE_ fileset ID.

In the ondemandjsfiles.xml file,

  • The fileset id tag should begin with the keyword WSPACE_ followed by the corresponding Workspace ID.
  • Within the fileset id, the file tag should contain all the files such as app class files, event listeners, and other JavaScript files.

For example,

<JsFiles>
	<fileset id = "WSPACE_PAYMENTS">
		<fileurl ="/javascript/AccountDetailConstants.js" />
		<fileurl ="/javascript/BillPaymentCellClickHandler.js" />
		<fileurl ="/javascript/StandingInstruction.js" />
		<fileurl="/javascript/payment.account.BenificiariesSummaryApp.js" />
	</fileset>
</JsFiles>