How do I delete selected documents in a XPage Dynamic View Panel

ε祈祈猫儿з 提交于 2019-12-08 01:55:03

问题


I created a Dynamic View Panel. I have check boxes on. I have called this "dynamicViewPanel1" and I have set the Data Source name to "dViewData"

So far so good, everything works fine.

Now I created a button called "Delete" and set it to a simple action of delete selected documents and set the view control to "dViewData".

When I select one or more documents and click delete I get the following error.

javax.faces.FacesException: Unable to find target view control dViewData. I take it because the data source is wrapped inside the Dynamic View panel?

I've checked the documentation, but I can't see how get the button to recognize the selected documents. Can anyone help me with this?


回答1:


Did you see and try this? 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
}

(I think the code above only handle view panels in the current database though)



来源:https://stackoverflow.com/questions/13528947/how-do-i-delete-selected-documents-in-a-xpage-dynamic-view-panel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!