xpages 将 UNID 传递给其他字段 [英] xpages passing the UNID to other field

查看:20
本文介绍了xpages 将 UNID 传递给其他字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个输入字段:

   <xp:inputText value="#{Cdoc.txt_UNID}" id="txt_UNID1"></xp:inputText>

字段 txt_UNID 的计算值为:@Text(@DocumentUniqueID).

The field txt_UNID is computed having the value: @Text(@DocumentUniqueID).

我注意到,即使我只是编写包含文档内容的 xpage,inputText 也已经包含一些 UNID,即使包含文档内容的 xpage 没有保存.

What I noticed is that even I just compose the xpage containing the document content the inputText already contains some UNID even if the xpage containing the doc content wasn't saved.

有一个按钮显示一个包含字段的对话框.我希望这个字段的值为 txt_UNID

There is a button which is showing a dialog containing a field. I want this field to have the value of txt_UNID

Cdoc.save(); // I must save first the Cdoc datasource ?
getComponent('exampleDialog').show()

以及该字段的代码:

<xp:inputText value="#{Pdoc.txt_CompanieUNID}"
id="txt_CompanieUNID1" defaultValue="#{Cdoc.txt_UNID}">
</xp:inputText>

感谢您的时间.

推荐答案

如果您的问题是是否必须先保存文档才能获得 UNID,那么我的回答是肯定的.在我的测试中,UNID 已从新文档更改为新保存的文档.因此,是的,如果当前文档是新文档,请在获取 UNID 之前保存.至少当它是一个 NotesXspDocument 时.

If your question is whether or not you must first save the document in order to get the UNID, my answer is yes. In my tests, the UNID has changed from a new document to a freshly saved document. So, yes if the current document is new, save before getting the UNID. At least when it was a NotesXspDocument.

我通常也为此使用 JavaScript,

I also generally use JavaScript for this,

cdoc.getDocument().getUniversalId();

否则,我不确定你在问什么.

Otherwise, I am unsure what you are asking.

这篇关于xpages 将 UNID 传递给其他字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆