This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



May 2, 2012, 7:18 PM
24 Posts

Using .js file as a Resource to an XPage

  • Category: Other
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 2
I am trying to use a .js file (located in Resources > Files in Designer) in an XPage and as far as I can tell you cannot do this in the Resources property of the XPage.
 
When I copy the actual Javascript in the .js file into a JavaScript Library, there are errors and it will not let me save the library --- this would fix the issue with the .js file, but it just won't save.
 
Hopefully there is some way to link a .js file to the Resources property of an XPage.
 
Thanks!
May 2, 2012, 8:25 PM
17 Posts
Re: Using .js file as a Resource to an XPage
 Add .js file as a file resource and build you own Theme and refer that file there.
 else, put the .js file in webContent folder which will be treated as 'root' of NSF 
May 3, 2012, 7:20 AM
126 Posts
Re: Using .js file as a Resource to an XPage
If your .js file is in the files folder under resources its just not going to pop up in the list of javascript resources because its expecting them to be in the javascript library folder.
 
You can still add it into your XPage you just have to manually type the file name such as 
 
<xp:this.resources> 
      <xp:script src="/fileName.js" clientSide="true">
</xp:this.resources> 
 
I've done exactly this with a custom dojo widget I made in a application, I was editing the .js file outside of designer and was just easier to use the file import rather than copy over the contents. worked fine. 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal