Display Standard Icon in XPage ViewPanel Column

Mindwatering Incorporated

Author: Tripp W Black

Created: 12/23/2011 at 05:16 PM

 

Category:
Notes Developer Tips
XPages

Goal:
Display an image icon in a view panel using the icons we've always had in the icons folder. The number icon doesn't currently work in XPages. You have to still <hack> it.

Solution:
The solution below uses getHTTPURL() which uses the server's name in the server document on 8.5.3.
This is bad if the server's FQDN on the server document is an internal address which doesn't resolve. If this is a danger for you, see Caveat below.
var url:XSPUrl = new XSPUrl(database.getHttpURL());
var idx = parseInt(viewEntry.getColumnValues().get(1));
var path = "/icons/vwicn" + ("00"+idx).right(3) + ".gif"
url.setPath(path);
url.removeAllParameters();
return url.toString();

Caveat:
The URL domain is the one in the server document. We have tried using Internet Sites and not using them and specifying the names in both the Server document and in the Internet Site and it always uses the FQDN field on the first tab of the server document.





previous page