我在xPage中有以下代码
<xp:viewPanel rows="30" id="viewPanelAuditDocuments"
width="50%">
<xp:this.data>
<xp:dominoView var="varFilesByPropNoYearCat"
viewName="vwFilesByPropNoYearCat" expandLevel="3">
<xp:this.categoryFilter><![CDATA[#{javascript:
if( viewScope.containsKey( "selectedProperty" ) )
mySelectedProperty = @Word( viewScope.selectedProperty, " - ", 1 );
else
mySelectedProperty = viewScope.selectedProperty = "-Select a Property-";
return mySelectedProperty;
}]]>
</xp:this.categoryFilter>
</xp:dominoView>
</xp:this.data>
<xp:viewColumn columnName="Year" id="viewColumn2"
showCheckbox="true">
<xp:viewColumnHeader value="Year"
id="viewColumnHeader2">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="Category" id="viewColumn3">
<xp:viewColumnHeader value="Category"
id="viewColumnHeader3">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="FileName" id="viewColumn4"
contentType="html" displayAs="link">
<xp:this.pageUrl><![CDATA[#{javascript:
jsLibGetAttachmentURL( varFilesByPropNoYearCat.getDocument().getUniversalID(), FileName );}]]>
</xp:this.pageUrl>
<xp:viewColumnHeader value="File Name"
id="viewColumnHeader4">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:this.facets>
<xp:pager partialRefresh="true"
layout="FirstImage PreviousImage SeparatorPage Group NextImage LastImage"
xp:key="footerPager" id="pager2" for="viewPanelAuditDocuments"
alwaysCalculateLast="true">
</xp:pager>
<xp:viewTitle xp:key="viewTitle" id="viewTitle1"
styleClass="lead color:red">
<xp:this.value><![CDATA[#{javascript:viewScope.selectedProperty; }]]></xp:this.value>
</xp:viewTitle>
<xp:inputHidden id="viewPanelSelectedIds"
xp:key="southEast" />
</xp:this.facets>
</xp:viewPanel>
在fileName列中,我正在尝试计算一个url来打开显示的文件附件名称。
当我打开页面时,我收到以下错误: 脚本解释器错误,line = 2,col = 88:[TypeError]在类型为'lotus.domino.local.View的对象上调用方法'getDocument()'时出错[Static Java Interface Wrapper,lotus.domino.local.View: lotus.domino.View]” 1:jsLibGetAttachmentURL(varFilesByPropNoYearCat.getDocument()。getUniversalID(),FileName);
如何在视图面板中获取文档的通用ID?
答案 0 :(得分:2)
我认为您应该在var
中指定xp:viewPanel
然后使用viewEntry.getUniversalID()
,例如varFilesByPropNoYearCat
。变量{{1}}将解析为整个视图,而不是单个条目。