Xpages - 每次保存文档时都会产生冲突 [英] Xpages - Conflict is created everytime a document is saved

查看:22
本文介绍了Xpages - 每次保存文档时都会产生冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 xpage,有多个标签.第一个选项卡包含一个面板,其内容仅在 isNewNote() 为 true 时才可编辑.所以我计算了面板的只读属性.

I have a xpage, with multiple tabs. First tab contains a panel, whose content are editable only when isNewNote() is true. So I computed readonly attribute for the panel.

但是每次我保存文档时,它都会创建一个新的冲突文档.

But everytime I save the document, it is creating a new conflict document.

同时,如果我取消选中只读属性,它会正确保存而没有任何冲突.

At the sametime,if I uncheck read-only property, it is saving properly without any conflict.

有人能帮我解决这个问题吗?

Can anybody help me to solve this issue?

代码 - Xpage

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">

    <xp:this.data>
        <xp:dominoDocument var="document1"
            formName="frmOnboardingRequest">
        </xp:dominoDocument>
    </xp:this.data>
    <xp:panel>
        <xp:this.readonly><![CDATA[#{javascript:if(document1.isNewNote()){
    return false;
}else{
    return true;
}}]]></xp:this.readonly>
        <xp:table>
            <xp:tr>
                <xp:td>
                    <xp:label value="O n_ e d_ form completed by:"
                        id="oN_ED_FormCompletedBy_Label1" for="oN_ED_FormCompletedBy1">
                    </xp:label>
                </xp:td>
                <xp:td>
                    <xp:inputText
                        value="#{document1.ON_ED_EmployeeName}"
                        id="oN_ED_FormCompletedBy1">
                    </xp:inputText>
                </xp:td>
            </xp:tr>
        </xp:table></xp:panel>
    <xp:button value="Submit" id="button1"><xp:eventHandler event="onclick" submit="true" refreshMode="complete" immediate="false" save="true"></xp:eventHandler></xp:button></xp:view>

推荐答案

检查指向同一文档的多个数据源.

Check for multiple datasources pointing to the same document.

之前的一些帖子有同样的问题xpage 在保存/提交时产生保存冲突

Some posts before with the same problem xpage creates save conflict on save/submit

XPage 中的多个数据源

Lotus Notes:代理和用户同时在文档上运行导致复制冲突

==================================================

=================================================

我不得不把按钮代码改成这样才能得到同样的问题

I had to change the button code to this to get the same problem

  <xp:button value="Submit" id="button1"><xp:eventHandler event="onclick" refreshMode="complete" submit="true">
    <xp:this.action>
        <xp:saveDocument></xp:saveDocument>
    </xp:this.action></xp:eventHandler></xp:button>

经过更多测试后,试试这个.

After some more testing, try this.

将此字段添加到 xpage 的末尾

Add this field to the end of the xpage

<xp:inputText id="inputText1"
        value="#{document1.temp}"
        style="visibility:hidden;display:none">
    </xp:inputText>

然后不会产生冲突.

这篇关于Xpages - 每次保存文档时都会产生冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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