1
votes

I have a computed column image ( icon ):

 <xp:this.iconSrc><![CDATA[#{javascript:var formName = rowData.getDocument().getItemValueString("Form");

var iconNumber = parseInt(rowData.getColumnValue("$8"));
if ( formName == "fmCompanie") {

"/.ibmxspres/domino/icons/vwicn" + (iconNumber > 99 ? "" : "0") + iconNumber + ".gif"}


else if ( formName == "fmPersContact" )

{  "" }}]]></xp:this.iconSrc>

The problem is when I want to open a document listed from my viewPanel, I get the following error: Exception occurred calling method NotesXspViewEntry.getDocument() null

at the following line of code:

var formName = rowData.getDocument().getItemValueString("Form");
1
rowData.getDocument() returns null. Probably a category. - Frantisek Kossuth
@FrantisekKossuth : I tried adding: if (!rowData.isCategory()) { // my code } but still the error exists. - Florin M.

1 Answers

7
votes

From the documentation for NotesXspViewEntry.getDocument()

Returns null if the view entry is not a document. Returns null if the document is deleted after the NotesXspViewEntry (JavaScript) object is created.

I don't think deletion is the problem but it might be a category or total. Check with isDocument()

if(rowdata.isDocument()) {
  var formName = rowData.getDocument().getItemValueString("Form");
  // other stuff...
}