2014-01-09 33 views
0

我有一個xpage,帶有多個選項卡。第一個選項卡包含一個面板,其內容僅在isNewNote()爲true時纔可編輯。所以我計算了面板的只讀屬性。Xpages - 每次保存文檔時創建衝突

但每次我保存文檔時,它都會創建一個新的衝突文檔。

與此同時,如果我取消選中只讀屬性,它將正確保存而不會發生任何衝突。

有人可以幫我解決這個問題嗎?

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

略有類似的問題還有一個鏈接,但他們的建議並沒有爲我工作:( - [XPages中奇怪的錯誤在8.5.2 ...](http://julianbuss.net/web /youatnotes/blog-jb.nsf/dx/unbelievable-bug-in-xpages-in-8.5.2....htm?opendocument&comments) – Saravanan

回答

3

檢查多個數據源指向同一個文件。

有同樣問題的一些帖子之前 xpage creates save conflict on save/submit

Multiple data sources in XPages

Lotus Notes: Replication conflict caused by agent and user running on the document at same time

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

編輯

我不得不按鈕代碼更改爲此得到同樣的問題

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

然後不產生衝突的結束。

+0

謝謝。我只有一個數據源,我只保存在onclick上一個按鈕,令人困惑的是,當我取消選中面板的「Read-Only」屬性時,不會創建衝突文檔。 – Saravanan

+0

發佈一些示例代碼,然後它更容易幫助 –

+0

我已經在主帖中包含一個簡單的xpage模擬此 – Saravanan

0

確實奇怪 - 但也沒有。您的數據源綁定到頁面,而不是面板。所以,如果你想只對面板中設置讀模式,考慮到與網頁的數據源計算板上的數據源:

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

當然你要計算的文件模式和文檔ID而不是使用只讀屬性。