FYI: How to use server-side script libraries in XPages successfully with Beta 1

If you want to use server-side script libraries in XPages for databases, you have two options to ‘attach’ the script libraries to the XPage (or custom control). You can either use the DDE UI and select the script library on the “Resources” tab, or you can use the javascript import statement (similar to the USE statement in Lotusscript) to explicitely load the script library.

Please be aware that in Beta 1, using the DDE UI does not work if the database resides in a sub-directory.

The workaround is to use the IMPORT statement inside your javascript code, i.e.

import scriptlibraryName;

// now you can call any code inside that scriptlibrary

The bug has been since fixed.

Thomas Gumz - Advisory Software Engineer - IBM Lotus Software
Being right is overrated. If your goal is usefulness, then what matters is progress.

Subject: Still a bug…

  • I just now failed to load a JavaScript library using the “Resources” in DDE, but I found this post on a Forum search and converted the Resource into an import. Works fine as frog hair.

  • This is 8.5 FP1.

Subject: Probably fixed in 8.5.1, just guessing.