xpages on click event from view panel column - 从视图弹出对话框表单 [英] xpages on click event from view panel column - pop up dialog forms from views
问题描述
有 2 个数据源:Cdoc
(文档内容)和 Pdoc
(在对话框中).
There are 2 datasources: Cdoc
( the doc. content ) and the Pdoc
( inside a dialog ).
这 2 个数据源基于 Cdoc'UNID
链接在一起.
These 2 datasources are linked together based on the Cdoc'UNID
.
我的主视图面板是这样的:
My main view panel is like this:
[_A_common_field] from Cdoc1 and all Pdocs from Cdoc1 ( this column is categorized )
Cdoc1
Pdoc 1 from Cdoc1
Pdoc 2 from Cdoc1
[_A_common_field] from Cdoc2 and all Pdocs from Cdoc2 ( this column is categorized )
Cdoc2
Pdoc 1 from Cdoc2
考虑到我希望在对话框中打开 Pdoc
(因为它被创建)和 ,我如何从我的
以经典"模式打开,就像未添加 viewPanel1
计算目标属性Cdoctarget
属性时一样?
How can I compute the target property from my viewPanel1
considering the fact that I want Pdoc
to be opened in the dialog ( as it was created ) and Cdoc
to be opened in the 'clasical' mode as it was when the target
property wasn't added ?
推荐答案
根据我从你的问题中了解到的,这就是我要做的,如果我错了或遗漏了任何内容,请纠正我:
As per what I understand from your question, this is what I will do, please correct me if I am wrong or missing anything here:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xc="http://www.ibm.com/xsp/custom">
<xp:this.data>
<xp:dominoView var="dominoView" viewName="ADR2"
search="#{javascript:param.searchValue}" dataCache="full">
</xp:dominoView>
</xp:this.data>
<xp:table id="viewPanela" styleClass="xspRepeatTable" cellpadding="0" cellspacing="0" style="width:98%">
<xp:tr styleClass="xspHeaderRow">
<xp:td style="width:2%"></xp:td>
<xp:td><xp:label value="Title" id="label1"></xp:label></xp:td>
<xp:td><xp:label value="Abteilung" id="label3"></xp:label></xp:td>
</xp:tr>
<xp:repeat id="repeatList" value="#{javascript:dominoView}"
var="ordnerData" rows="10" indexVar="repeatIndex">
<xp:tr id="tr1">
<xp:td><xp:image id="image1" style="width:12px" url="#{javascript:return findImage(ordnerData.getColumnValue('aIcon'));}"></xp:image></xp:td>
<xp:td>
<xp:div id="div1">
<xp:this.style>
<![CDATA[#{javascript:var level = ordnerData.getIndentLevel();
if(level != null && level > 0){
return "padding-left:" + (level * 10) + "px !important";
}else{
return "";
}}]]>
</xp:this.style>
<xp:link id="link1">
<xp:this.rendered><![CDATA[#{javascript:ordnerData.getChildCount() > 0}]]></xp:this.rendered>
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="viewPanela" immediate="true">
<xp:this.action><![CDATA[#{javascript:ordnerData.toggleExpanded()}]]></xp:this.action>
</xp:eventHandler>
<xp:image id="image5" alt="Toggle Row">
<xp:this.url><![CDATA[#{javascript:if(ordnerData.isExpanded()){
return("/tree_minus.gif");
}else{
return("/tree_plus.gif");
}}]]></xp:this.url>
</xp:image>
</xp:link>
<xp:text escape="true" id="computedField3">
<xp:this.value><![CDATA[#{javascript:return " " +ordnerData.getColumnValue('$92')}]]></xp:this.value>
</xp:text>
</xp:div>
</xp:td>
<xp:td><xp:text escape="true" id="computedField4" value="#{javascript:ordnerData.getColumnValue('$95')}"></xp:text></xp:td>
<xp:eventHandler event="ondblclick" submit="false">
<xp:this.script><![CDATA[var docid="#{javascript:ordnerData.getDocument().getUniversalID()}";
var link="";
var typ="#{javascript:ordnerData.getDocument().getItemValueString('aTyp')}";
link='xx_openPageN.xsp?aTyp='+typ+'&action=openDocument&documentId='+docid;
window.open(link,'New','width=1000, height=650, left=250px, top=250px, menubar=no, resizable=0, scrollbars=yes');
]]></xp:this.script>
</xp:eventHandler>
</xp:tr>
</xp:repeat>
<xp:tr styleClass="xspPagerRow">
<xp:td colspan="4" align="right" style="width:100%">
<xp:pager xp:key="headerPager" for="repeatList"
id="pagerTop" partialRefresh="true"
style="font-weight:inherit;margin-right:0.0px"
layout="SeparatorPage Status FirstArrow Separator PreviousArrow Separator SeparatorPage Group Separator NextArrow Separator LastArrow">
</xp:pager>
</xp:td>
</xp:tr>
</xp:table>
</xp:view>
说明
我有一个简单的 dominoView 作为 viewSource,在您的情况下,它是一个分类视图,Cdoc 和 Pdoc 作为响应文档.要确定当前单击的文档,您可以使用一个简单的 javascript:
I have a simple dominoView as a viewSource which in your case would be a categorized view with Cdoc and Pdoc as response document. To determine the current clicked document , there is a simple javascript you can use:
if(level != null && level > 0)
return "Is a PDoc with document id "+ordnerData.getDocument().getUniversalID();
else
return "Is a CDoc with document id "+ordnerData.getDocument().getUniversalID();
现在,这允许您对不同的文档执行不同的计算.如果你看到我的例子,我只是在编辑模式下打开一个包含相应文档的新窗口.您可以在此处根据您的要求设置条件(例如,对话框中的 PDoc 和窗口中的 CDoc).如果有任何不清楚或遗漏的地方,请告诉我.很抱歉在这件事上迟到了.希望这能解决您的问题.
Now, this allows you to perform different computation on different document. If you see my example, I just open a new window with the respective document in edit mode. You can have conditions based on your requirement here (eg. PDoc in a dialog and CDoc in a window). Please let me know if anything is not clear or missing. Sorry for being late on this. Hope this solves your problem.
这篇关于xpages on click event from view panel column - 从视图弹出对话框表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!