我将简短介绍我的小项目应用程序:
主要文件。内容是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
。
主要的。docCdoc
还包含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
从对话框中知道原因)。
我的Save
按钮Cdoc
应该如何?我也应该更改“Save
从”Pdoc
按钮吗?
谢谢你的时间。
我相信按钮上的save =“ true”将提交并保存页面上的所有数据源。那可以解释伪造的Pdoc文档。您正在调用保存在脚本中,因此不需要save =“ true”-您可以仅使用常规的Button类型,而不是按钮的Submit类型。
保存文档后,将不会更改UNID。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句