Some time ago Jo Grant posted an article on the Lotus Notes and Domino Application Development wiki with a tip about how to reference the view icon images installed with the Domino server or Notes Client. This involved using server-side javascript to manipulate the XSPUrl class, removing parameters and creating a new URL. This is a very powerful technique that I used on a number of occasions when working on my own XPages application.

About a month ago I used this technique to reference images in the dominohtmloneuiv2images folder. A day or so later I started thinking about oneuiv2, recalling that resources (such as css files) from oneuiv2 are also referenced in themes. I wondered whether the technique used to reference css files in the oneuiv2 folder structure could also be used to reference images.

Sure enough, it works. As well as using server-side javascript to manipulate the XSPUrl class, it’s also possible to use “/.ibmxspres” to access the data folder and so sub-folders. For me, I could reference iconConfirmation16.png in my Program FilesIBMLotusDominodatadominohtmloneuiv2images folder with the following code:

“/.ibmxspres/domino/oneuiv2/images/iconConfirmation16.png”

NB The html subfolder must be omitted from the path, if you include that, it’ll fail.

The same technique can also be used to access the icons, e.g. “/.ibmxspres/domino/icons/vwicn101.gif”.

And if you’ve got already got a column set to display view icons, the following server-side javascript will work:

“/.ibmxspres/domino/icons/vwicn” + @Right(“00″+@Text(myDoc.getColumnValue(“Status”)),3) + “.gif”

2 thoughts on “A useful tip for server-based images from an XPage”

  1. And for referencing images in the <data>dominojavaxsp folders and subfolder, you need “/.ibmxspres/global…”, so “./ibmxspres/global/theme/common/images/iconDatePicker.gif” will give you the calendar date picker image that shows for date fields using the oneui or other similar themes.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top