2013-02-15 17 views
0

我有一個按鈕,它執行dblookup來獲取notesDocument。我想將數據源設置爲該文檔,以便我可以在xpage的其他地方使用它。如何將數據源設置爲筆記文件

例如,我有三個不同的按鈕作用於相同的文檔。我不想在每個按鈕中查找該文檔。

我試着將數據源docUNID設置爲第一個執行dblookup的按鈕中更新的作用域變量,然後刷新xPage,但似乎沒有更新數據源。

有什麼想法?

回答

1

確保您dblookup返回docunid和你dblookup中的Docment數據源添加到documentUniqueID屬性設置中使用XPages,然後使用數據源變量保存或更新值

有對dblookup關鍵字得到UNID也可以返回一個包含UNID

像這樣

<xp:panel> 
    <xp:this.data> 
     <xp:dominoDocument var="doc" action="openDocument" 
      documentId="#{javascript:@DbLookup(...)}"> 
     </xp:dominoDocument> 
    </xp:this.data> 
    <xp:button value="Label" id="button1"> 
     <xp:eventHandler event="onclick" submit="true" 
      refreshMode="complete"> 
      <xp:this.action><![CDATA[#{javascript:doc.save()}]]></xp:this.action> 
     </xp:eventHandler></xp:button> 
    <xp:button value="Label" id="button2"> 
     <xp:eventHandler event="onclick" submit="true" 
      refreshMode="complete"> 
      <xp:this.action><![CDATA[#{javascript:doc.save()}]]></xp:this.action> 
     </xp:eventHandler></xp:button> 
    <xp:button value="Label" id="button3"> 
     <xp:eventHandler event="onclick" submit="true" 
      refreshMode="complete"> 
      <xp:this.action><![CDATA[#{javascript:doc.save()}]]></xp:this.action> 
     </xp:eventHandler></xp:button> 

相關問題