wan fai commented on Nov 18, 2013

Re: Using a icon view column in an XPage

It does not work in Categorized view. When collapse button is clicked, error occurs.

com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression

Error while executing JavaScript computed expression

Script interpreter error, line=3, col=21: [TypeError] Exception occurred calling method NotesXspViewEntry.getColumnValue(string) null

wan fai commented on Nov 18, 2013

Re: Using a icon view column in an XPage

If it is a categorized view, it doesn't work. When collapse icon is clicked, error occurs.

com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression

Error while executing JavaScript computed expression

Script interpreter error, line=3, col=21: [TypeError] Exception occurred calling method NotesXspViewEntry.getColumnValue(string) null

Martin Perrie commented on Mar 21, 2012

Re: Using a icon view column in an XPage

The link to the video just points back to this page

Ljubisha Ugrenovikj commented on Jul 4, 2011

Error

I add this code in the value of the column, and this is what i get.

Error while executing JavaScript computed expression

Script interpreter error, line=3, col=21: [ReferenceError] 'viewEntry' not found

Please bare in mind that im no programmer or anything, im quite new to xpages. I need to display an icon in column if there are attachments in the document.

Tnx for helping

Luc jp Guislain commented on Nov 26, 2010

Using a icon view column in an XPage

I use this piece of code to display view column icons in Web browser and in Notes. (xColumn to change)

if(@ClientType()=="Notes"){

return "/.ibmxspres/icons/vwicn" + @Right("00"+@Text(viewEntry.getColumnValue("xColumn")),3) + ".gif";

}else{

return "/.ibmxspres/domino/icons/vwicn" + @Right("00"+@Text(viewEntry.getColumnValue("xColumn")),3) + ".gif";

}

Paul S. Withers commented on Mar 26, 2010

Using a icon view column in an XPage

Nice solution, I wanted to use an image available with one of the oneuiV2 themes, and it worked great. But themes also reference resources, so after a bit of extrapolation, I confirmed that the syntax used in themes also works in image resources - "./ibmxspres" gets to the Data folder. So to convert a column image I just use the following SSJS:

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

Nicolas Kauffmann commented on Oct 28, 2009

Ooops

Sorry - was too quick.

If(viewEntry) doesn't work.

I've done it with try ... catch.

Nicolas Kauffmann commented on Oct 28, 2009

Avoid error at view-change

Thanks for that snippet! This was great help!

When I change the xpage+view by a button-click,

I got an error (getColumnValue(s) null).

I solved this by enclosing the snippet in an if-block:

if(viewEntry){

<the great snippet from above...>

}

Pablo Solano commented on Oct 12, 2009

Here an example for custom icons.

This piece of code shows a custom icon view column like (low.gif, medium.gif, etc.)

//Get Db Url

var url:XSPUrl = new XSPUrl(database.getHttpURL());

// Get column value with icon property. Col 0 = first column, Col 1 = second column, etc.

var idx = viewEntry.getColumnValues().get(4);

//Compute url for resource image

var path = "/"+ idx + "?OpenImageResource"

//Remove ?OpenDatabase parameter from URL Database

url.removeParameter("OpenDatabase");

//Return icon path

return url.toString() + path;

JP Shelley commented on May 15, 2009

Excellent, thank you, but ...

2 things I needed to change were :-

- detick the Value box, so that only Icon is ticked;

- in A Nebel's reply I had to change "(entry." to "(viewEntry."

Xpages is a difficult and huge subject to learn to master, so thank you Jo for your help.

a nebel commented on Feb 5, 2009

Great :-)

I solved the problem in a similar way in the last days. A have a small improvement to the path computing (Without IF).

var url:XSPUrl = new XSPUrl(database.getHttpURL());

var idx = parseInt(entry.getColumnValues().get(2));

var path = "/icons/vwicn" + ("00"+idx).right(3) + ".gif"

url.setPath(path);

url.removeAllParameters();

return url.toString();