单击视图中计算出的页面 url 打开空白页面(新页面) [英] open blank page (new page) on clicking calculated page url in a view
问题描述
我已经关注了 viewPanel.当用户点击计算出的页面 url 时,我想打开一个新页面.我只是似乎不明白这一点.
I've got following viewPanel. I would like to open a new page when the users clicks on the calculated page url. I just don't seem to figure this out.
<xp:viewPanel rows="30" id="viewPanel9" showColumnHeader="false" var="rowData"viewStyle="width:auto" disableTheme="true">
<xp:this.data>
<xp:dominoView var="view9" databaseName="product/picture.nsf"
viewName="pictures3" keysExactMatch="true"
keys="#{javascript:sessionScope.SelectedProduct;}">
</xp:dominoView>
</xp:this.data>
<xp:this.rendered><![CDATA[#{javascript:getComponent("viewPanel9").getRowCount() > 0}]]>
</xp:this.rendered>
<xp:viewColumn columnName="picDescr" id="viewColumn9" displayAs="link" openDocAsReadonly="true">
<xp:this.iconSrc><![CDATA[#{javascript:thisid = rowData.getColumnValue("unid");
thisdocument = rowData.getColumnValue("picName");
calculatedlink = "servername/product/picture.nsf/O/"+thisid+"/$FILE/"+thisdocument;
return calculatedlink}]]>
</xp:this.iconSrc>
<xp:this.pageUrl><![CDATA[#{javascript:thisid = rowData.getColumnValue("unid");
thisdocument = rowData.getColumnValue("picName");
picturename = thisdocument.replace("th_","");
calculatedlink = "servername/product/picture.nsf/O/"+thisid+"/$FILE/"+picturename;
return calculatedlink}]]></xp:this.pageUrl>
<xp:viewColumnHeader value="Description" id="viewColumnHeader9">
</xp:viewColumnHeader>
</xp:viewColumn>
</xp:viewPanel>
推荐答案
前段时间,我正在努力解决同样的问题.我为它创建了一个可行的解决方法,但我不知道这是否是最好的方法.
Some time back I was grappling with same issue. I created a workaround for it which works, but I don't know if it is the best way to go about it.
首先将xp:viewColumn
的displayAs
属性设置为hidden
.所以它看起来像这样:
First set the displayAs
attribute of xp:viewColumn
to hidden
. So it looks something like this:
<xp:viewColumn columnName="picDescr" id="viewColumn9" displayAs="hidden" openDocAsReadonly="true">
现在在列中放置一个链接控件,您必须在源选项卡中执行此操作.然后,您可以将链接控件的 target
属性设置为 _blank
.所以你的代码看起来像这样:
Now put a Link control in the column, you would have to do this in Source tab. You can then set the target
attribute to _blank
for the Link control. So your code would look something like this:
<xp:viewColumn columnName="picDescr" id="viewColumn9" displayAs="hidden" openDocAsReadonly="true">
<xp:link escape="true" target="_blank">
<xp:this.text><![CDATA[#{javascript:rowData.getColumnValue("picDescr");}]]></xp:this.text>
<xp:this.value><![CDATA[#{javascript:thisid = rowData.getColumnValue("unid");
thisdocument = rowData.getColumnValue("picName");
picturename = thisdocument.replace("th_","");
calculatedlink = "servername/product/picture.nsf/O/"+thisid+"/$FILE/"+picturename;
return calculatedlink}]]></xp:this.value>
</xp:link>
...
...
...
</xp:viewColumn>
这篇关于单击视图中计算出的页面 url 打开空白页面(新页面)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!