我有一个xpage,有多个标签。第一个选项卡包含一个面板,仅当IsNewNote()为真时才可编辑的内容。因此,我计算了面板的ReadOnly属性。

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

在sametime,如果我取消选中只读属性,它会在没有任何冲突的情况下妥善保存。

任何人都可以帮助我解决这个问题吗?

代码 - 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>
.

有帮助吗?

解决方案

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

在同一个问题之前的一些帖子 xpage创建保存/提交

保存冲突

xpages中的多个数据源

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

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

编辑

我不得不将按钮代码更改为此以获得相同的问题

  <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>
.

经过更多的测试,尝试这个。

将此字段添加到xpage

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

然后没有创建冲突。

其他提示

Strange indeed - but also not. Your data source is bound to the page and not to the panel. So if you want to set read mode only for that panel, consider to calculate the panel's datasource from the page's datasource:

<xp:panel>
    <xp:this.data>
        <xp:dominoDocument var="document1" action="openDocument"></xp:dominoDocument>
    </xp:this.data>
</xp:panel>

Of course you have to calculate the document mode and the docid instead of using the readonly property.

In addition to the other suggestions, when working with tabbed tables you will want to follow this blog post carefully. I have been through similar issues on a previous project and Tommy Valand's redirectToCurrentDocument() fixed them.

http://dontpanic82.blogspot.com/2010/06/xpages-avoid-saving-duplicate-documents.html

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top