xpages view panel display computed icon

227 Views Asked by At

I'm trying to display an icon in a view panel based on a column value. This page will display if I only display the column value and/or use a static database image. If however I try to compute the image based on the column value I get an Http Code 500 error. Looking at the error-log I see two errors, the first is CLFAD0211E: Exception thrown and the second CLFAD0246E: Exception occurred servicing request for .

I have reviewed this simple explanation on how to add a dynamic icon (https://www.youtube.com/watch?v=27MvLDx9X34) and other similar articles and still not working. Below is the code for the computed icon.

var urlFull:XSPUrl = new XSPURL(database.getHttpURL());
var url = urlFull.getHost();
var path = "/icons/vwicn";
// var idx = rowData.getColumnValues().get(1); Removed for testing
var idx = "82.0"; //Hard coded the value for testing
if (idx < 10){
    path += ("00" + idx).left(3);
}else if (idx < 100){
    path += ("0" + idx).left(3);
}else {
    path += idx.left(3);
}

path += ".gif";
//path = "/icons/vwicn082.gif";  I have also tried hard coding the path value - still a no go
url = setPath(path);
url.removeAllParameters();
return url.toString();

The view panel is configured as xp:viewPanel rows="40" id="viewPanel1" var="rowData".

Any suggestions on what to look for or a better option to compute a view panel icon would be appreciated.

Cheers!!!

1

There are 1 best solutions below

0
On

You have a typo: url = setPath(path);should be url.setPath(path);