【发布时间】:2014-06-25 16:15:07
【问题描述】:
我将简要描述我的小项目应用程序:
主文档。内容是Cdoc(包含字段+按钮的数据源)。这个按钮显示一个对话框,它是Pdoc(一个数据源)——在显示按钮之前,我将保存文档。获取UNID,然后将其传递给Pdoc,我想将Cdoc和Pdoc与UNID链接。
我的显示对话框的按钮:
<xp:button value="Adding Pdoc from the dialog" id="button3"
styleClass="lotusFormButton" refreshMode="partial">
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="computedField3">
<xp:this.action><![CDATA[#{javascript: if ( Cdoc.isNewNote() ) { Cdoc.save(); }
Cdoc.setValue("computedField3",Cdoc.getDocument().getUniversalID());
getComponent('exampleDialog').show()}]]></xp:this.action>
</xp:eventHandler>
对话框/Pdoc 仅包含 1 个按钮:Save(因为 X 按钮已隐式添加到对话框中)
<xp:button value="Salvare" id="button6" styleClass="lotusFormButton">
<xp:eventHandler event="onclick"
submit="true" refreshMode="partial" immediate="false"
save="false" refreshId="viewPanel1">
<xp:this.action><![CDATA[#{javascript:Pdoc.save();
getComponent('exampleDialog').hide();
}]]>
</xp:this.action>
</xp:eventHandler>
所以,它保存了文档。来自Pdoc,它们显示在来自Cdoc的嵌入视图中。
主要。 doc Cdoc 还包含 2 个(操作)按钮:
Cancel: redirect to Previous Page.
和
Save
<xp:button value="Salvare" id="buttonSave" styleClass="lotusFormButton" rendered="#{javascript:currentDocument.isEditable()}">
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" immediate="false" save="true"
id="eventHandler1">
<xp:this.action><![CDATA[#{javascript:if (Cdoc.getItemValueString("txt_UNID")!= "") {
Cdoc.save();
}
facesContext.getExternalContext().redirect("http://ourserver.ro/XApp.nsf/view.xsp")
}]]></xp:this.action>
</xp:eventHandler>
</xp:button>
问题是:
假设我将创建 3 个文档。来自Pdoc 来自对话框,Cdoc。已保存(因为已获得 UNID)。如果我保存然后使用Cdoc Save, 我来自view.xsp 的主视图面板将显示:
一个文档。
Cdoc及其 3 个Pdoc文档。 (我只需要展示这个案例)另一个
Cdoc(我想当我第一次获得UNID并保存Cdoc以获得UNID时,在这种情况下这是Cdoc。顺便说一句,如果我再次保存Cdoc使用Save按钮,UNID会改变吗?)和一个空的(不知道为什么)Pdoc来自对话框。
来自Cdoc 的Save 按钮应该是什么样的?我是否也应该将 Save 从 Pdoc 按钮更改?
感谢您的宝贵时间。
【问题讨论】:
-
我的 Cdoc:
标签: xpages xpages-ssjs