Question

J'ai un xpage, avec plusieurs onglets.La première onglet contient un panneau dont le contenu n'est éditable que lorsque ISnewnote () est vrai.Donc, j'ai calculé l'attribut Readonly pour le panneau.

Mais chaque fois que je sauvegarde le document, il crée un nouveau document de conflit.

au Sametime, si je décochez la propriété en lecture seule, il économise correctement sans aucun conflit.

Quelqu'un peut-il m'aider à résoudre ce problème?

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

Était-ce utile?

La solution

Vérification de plusieurs données de données pointant sur le même document.

Certains postes avant avec le même problème Xpage crée un enregistrement de conflit sur Enregistrer / soumettre

Plusieurs sources de données dans Xpages

Lotus Notes: le conflit de réplication causé par l'agent et l'utilisateur exécutant sur le document en même temps

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

Modifier

J'ai dû changer le code du bouton à ceci pour obtenir le même problème

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

Après plus de tests supplémentaires, essayez ceci.

Ajoutez ce champ à la fin de la xpage

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

alors aucun conflit n'est créé.

Autres conseils

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top