2012-11-23 21 views
2

我創建了動態視圖面板。我有複選框。我把這種現象稱之爲「dynamicViewPanel1」和我已經設置了數據源名稱爲「dViewData」如何刪除XPage動態視圖面板中的選定文檔

到目前爲止好,一切工作正常。

現在,我創建了一個名爲「刪除」,將其設置爲刪除所選文件的一個簡單的動作,並設置視圖控件「dViewData」按鈕。

當我選擇一個或多個文檔並單擊刪除時,出現以下錯誤。

javax.faces.FacesException:無法找到目標視圖控件dViewData。我拿它是因爲數據源被封裝在動態視圖面板中?

我檢查了文檔,但我看不到如何讓按鈕識別選定的文檔。誰能幫我這個?

回答

6

您是否看到並嘗試過? http://www-10.lotus.com/ldd/ddwiki.nsf/dx/2008-11-11033022WEBBZ4.htm

var viewPanel=getComponent("viewPanel1");get the componet of viewPanel 
var docIDArray=viewPanel.getSelectedIds(); get the array of document ids 
for(i=0; 
i < docIDArray.length; 
i++){ 
    var docId=docIDArray[i]; 
    var doc=database.getDocumentByID(docId); 
    .. your code to deal with the selected document 
} 

(我覺得上面的代碼只處理視圖面板在當前數據庫雖然)

+0

好極了!謝謝!所以要刪除我使用該代碼:doc.remove(true); doc.recycle(); – Herty