Xpages-向Notes视图中的列添加锚定标记

Xpages-向Notes视图中的列添加锚定标记,xpages,lotus-notes,lotus-domino,xpages-ssjs,notesview,Xpages,Lotus Notes,Lotus Domino,Xpages Ssjs,Notesview,我想在Notesview中的一列中添加一个链接,我在上一次尝试时看到了一个例子,失败了,错误是“需要一个运算符或分号,但没有遇到”,所有其他努力都被证明是失败的 下面是searchdomino的示例: <a href='#' onClick="window.open('/"+@WebDbName+"/Employee/"+@Text(@DocumentUniqueID)+"?deleteDocument ','_new');window.location.reload()">Del

我想在Notesview中的一列中添加一个链接,我在上一次尝试时看到了一个例子,失败了,错误是“需要一个运算符或分号,但没有遇到”,所有其他努力都被证明是失败的

下面是searchdomino的示例:

<a href='#' 
onClick="window.open('/"+@WebDbName+"/Employee/"+@Text(@DocumentUniqueID)+"?deleteDocument ','_new');window.location.reload()">Delete</a>

我能够通过执行以下操作来克服错误,但无法调用onclick事件

"<a href='#' onClick='window.open'>" + "/"+@WebDbName+"/employee.xsp?action=openDocument&documentId="+@Text(@DocumentUniqueID) + "</a>"
“”
您的意见将不胜感激

将notesview列值注入html表,示例代码:

 if(entryData[j].getAttribute("columnnumber") == "1") {            
    var xpageName = "page.xsp";
    var sURL = strURL[0] + ".nsf/" + xpageName + "?documentId=" + viewEntry[i].getAttribute("unid") + "&action=editDocument";

    result += "<tr> ";

    if(entryData[j].childNodes[1].childNodes.length == 0) {
        result += "<td><a href='" + sURL + "'>(NO_VALUE)</a></td>"
    } else {
        result += "<td><a href='" + sURL + "'>" + entryData[j].childNodes[1].childNodes[0].nodeValue + "</a></td>"
    }
} else {
    if(entryData[j].childNodes[1].childNodes.length == 0) {
        result += "<td>&nbsp;</td>"
    } else {
        result += "<td>" + entryData[j].childNodes[1].childNodes[0].nodeValue + "</td>"

    }
}
if(entryData[j].getAttribute(“columnnumber”)=“1”){
var xpageName=“page.xsp”;
var sURL=strURL[0]+”.nsf/“+xpageName+”?documentId=“+viewEntry[i].getAttribute(“unid”)+”&action=editDocument”;
结果+=”;
if(entryData[j].childNodes[1].childNodes.length==0){
结果+=“”
}否则{
结果+=“”
}
}否则{
if(entryData[j].childNodes[1].childNodes.length==0){
结果+=“”
}否则{
结果+=“”+entryData[j]。childNodes[1]。childNodes[0]。nodeValue+“”
}
}

如果查看正在生成的HTML代码,您将看到没有向window.open传递任何参数。 您的代码:

"<a href='#' onClick='window.open'>" + "/"+@WebDbName+"/employee.xsp?action=openDocument&documentId="+@Text(@DocumentUniqueID) + "</a>"
“”
这将呈现如下内容:

<a href='#' onClick='window.open'>/database.nsf/employee.xsp?action=openDocument&documentId=26176F6E8AC2362E3</a>
<a href='#' onClick='window.open("/database.nsf/employee.xsp?action=openDocument&documentId=26176F6E8AC2362E3")'>Click this link</a>

您需要在onClick事件中移动URL,如下所示:

<a href='#' onClick='window.open'>/database.nsf/employee.xsp?action=openDocument&documentId=26176F6E8AC2362E3</a>
<a href='#' onClick='window.open("/database.nsf/employee.xsp?action=openDocument&documentId=26176F6E8AC2362E3")'>Click this link</a>

或者为什么不仅仅是这个:
单击此链接

如果查看正在生成的HTML代码,您将看到没有向window.open传递任何参数。 您的代码:

"<a href='#' onClick='window.open'>" + "/"+@WebDbName+"/employee.xsp?action=openDocument&documentId="+@Text(@DocumentUniqueID) + "</a>"
“”
这将呈现如下内容:

<a href='#' onClick='window.open'>/database.nsf/employee.xsp?action=openDocument&documentId=26176F6E8AC2362E3</a>
<a href='#' onClick='window.open("/database.nsf/employee.xsp?action=openDocument&documentId=26176F6E8AC2362E3")'>Click this link</a>

您需要在onClick事件中移动URL,如下所示:

<a href='#' onClick='window.open'>/database.nsf/employee.xsp?action=openDocument&documentId=26176F6E8AC2362E3</a>
<a href='#' onClick='window.open("/database.nsf/employee.xsp?action=openDocument&documentId=26176F6E8AC2362E3")'>Click this link</a>

或者为什么不仅仅是这个:
单击此链接

您需要处理三个级别的报价,因此我认为这就是您需要的:

{<a href='#' onClick="window.open('/}  + @WebDbName +  {/Employee/} +@Text(@DocumentUniqueID)+ {?deleteDocument ','_new');window.location.reload()">Delete</a>}
{}
也就是说,这是在使用

  • {}用于引用公式字符串值
  • “”用于在公式字符串值中引用onClick属性值
  • “”用于引用公式字符串值中onClick属性值内的window.open参数值

您需要处理三个级别的报价,因此我认为这就是您需要的:

{<a href='#' onClick="window.open('/}  + @WebDbName +  {/Employee/} +@Text(@DocumentUniqueID)+ {?deleteDocument ','_new');window.location.reload()">Delete</a>}
{}
也就是说,这是在使用

  • {}用于引用公式字符串值
  • “”用于在公式字符串值中引用onClick属性值
  • “”用于引用公式字符串值中onClick属性值内的window.open参数值

能否显示Xpage这一部分的源代码?我在上面添加了将列值注入html表的示例代码。能否显示Xpage这一部分的源代码?我在上面添加了将列值注入html表的示例代码。