我之前添加了这个问题xpages passing the UNID to other field ......目前看起来它的工作。xpages为什么我的字段值不能正确复制
我创建的<xe:dialog>
结构(其使用一个单一的数据源:Pdoc
)后,我观察我不能得到的其他数据源的正确UNID
:Cdoc
。有一个计算字段:该对话框是由具有数据源Cdoc.
在主XPAGE(Cdoc
其具有作为数据源):所述的XPages显示(txt_UNID
是具有式@Text窗体上(@uniquedocumentid))
<xp:text escape="true" id="computedField3" value="#{Cdoc.txt_UNID}"></xp:text>
和一个按钮,用于显示的对话框:
<xp:button value="Adding a Pdoc structure inside my dialog" id="button3"
styleClass="lotusFormButton" refreshMode="partial" rendered="#{javascript:currentDocument.isEditable()}">
<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() }
else
{
Cdoc.setValue("computedField3",Cdoc.getDocument().getUniversalID());
getComponent('exampleDialog').show()}
}]]></xp:this.action>
</xp:eventHandler>
</xp:button>
该对话框具有refreshOnShow
集到true
。在对话框里面,有一个字段(绑定到Pdoc
源),我想显示存储在一计算领域,从我的主要的XPage Cdoc
的UNID:
<xp:inputText value="#{Pdoc.txt_CompanieUNID}"
id="inputText1" defaultValue="#{Cdoc.txt_UNID}">
</xp:inputText>
我认为这个问题是在这里.. 。而不是#{Cdoc.txt_UNID}
,我曾尝试添加getComponent("computedField3").getValue()
作为我的以上inputText
的默认值,但我得到一个错误,考虑到事实,我想,computedField3
不在对话框内? 我在做什么错?
顺便说一句,该对话框中包含众多领域(绑定到PDOC)具有默认值:
Cdoc.<field_name>
和它的作品确定。我不知道为什么在computedField3/txt_UNID
的情况下不起作用。 感谢您的时间!
我确实在您的按钮代码中添加了您的建议。但是,我的问题(正如问题标题中所述)是我无法将此值(从computedField3或txt_UNID)传递到对话框中的字段。显示对话框后的txt_UNID有一个值,对话框中的字段有其他值/ UNID –
您确定Cdoc在txt_UNID字段中有值吗? –
此字段:是可见的,所以我可以验证该值。事实上,在显示对话框之后,这个字段包含一个值/ UNID。 –