Xpages - конфликт создан каждый раз, когда документ сохраняется

StackOverflow https://stackoverflow.com//questions/21015953

Вопрос

У меня есть 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 создает конфликт Сохранить / peading

Несколько источников данных в xpages

Другие советы

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