I am having a problem filling in a table when using SSJS on my xPage.
The code I am using to create and then navigate to the table is
var user = session.getEffectiveUserName();
var doc = database.createDocument();
var rtitem:NotesRichTextItem = doc.createRichTextItem("Body");
doc.Form = "Memo";
doc.replaceItemValue("SendTo", user)
doc.replaceItemValue("Subject","Renewal forms received");
var i:Double = sessionScope.unidArray.size();
rtitem.appendTable(i,12);
var rtnav = rtitem.createNavigator();
rtnav.findFirstElement(RTELEM_TYPE_TABLE);
rtnav.findFirstElement(RTELEM_TYPE_TABLECELL);
try{
for(v=0;v<i;v++){
print("v is " + v);
for(j=3;j<=14;j++){
rtitem.beginInsert(rtnav);
rtitem.appendText(sessionScope.unidArray(v,j));
rtitem.endInsert();
rtnav.findNextElement(RTELEM_TYPE_TABLECELL);
}
}
}catch(e){
print("error " + e);
}
The error I am getting is
Script interpreter error, line=18, col=24: [ReferenceError] 'RTELEM_TYPE_TABLE' not found
16: print("3");
17: var rtnav = rtitem.createNavigator();
-> 18: rtnav.findFirstElement(RTELEM_TYPE_TABLE);
I have tried using
rtitem.RTELEM_TYPE_TABLE
at line 18 above that throws up an error as well.
Any suggestions on what I am doing wrong would be appreciated.
Thanks
Graeme