xpages UNID of documents / why it is changing

冷暖自知 提交于 2019-12-12 02:05:54

问题


I'm trying to link 2 documents ( Cdoc and Pdoc ) based on the Cdoc UNID.

I have a computed field ( computedfield3 ) which is binded to a form'computed field having the default value @text(@documentuniqueid). The Pdoc is inside a dialog which I show it using a button.

The button contains a Partial Update for ID:computedField3.

The button code:

 if ( Cdoc.isNewNote() ) { Cdoc.save();
 Cdoc.setValue("computedField3",Cdoc.getDocument().getUniversalID());
 getComponent('exampleDialog').show() }
 else
 {
 Cdoc.setValue("computedField3",Cdoc.getDocument().getUniversalID());
 getComponent('exampleDialog').show()}

Then I pass the computedField3 value to Pdoc using custom control properties.

I noticed if I opened an existing already saved Cdoc, open it and add again a Pdoc from the dialog, the existing UNID from the Cdoc is changing... Is from the partial update?

How can I make it OK ?

Thanks for your time


回答1:


The key is not the save code. It's the dominoDocument datasource definition. Please see my latest comment here xpages save / cancel actions scenario

With ignoreRequestParams set to true and no documentId computed, you're always working on a new document.



来源:https://stackoverflow.com/questions/24407003/xpages-unid-of-documents-why-it-is-changing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!