How to get marked rows in the XPages Extension Library <xe:dataView> design element?

回眸只為那壹抹淺笑 提交于 2019-12-12 01:54:09

问题


I have a XPage with design element. How can I get list of checked rows to post it to an agent?

<xe:dataView id="dataView1" columnTitles="true"
    expandedDetail="true" var="dview1" 
    openDocAsReadonly="false" rows="15" showCheckbox="true"
    showHeaderCheckbox="true">

Thank you!


回答1:


For the client-side, you can use Dojo. The following CSJS script will return NoteIds for all selected rows:

dojo.query(".lotusFirstCell > input:checked").attr('value')

For the server side, you can grab the IDs of selected documents by:

var idList = getComponent("dataView1").getSelectedIds();

This will return a string array of NoteIDs. Then pass it to an in-memory document and call the agent.

var doc = database.createDocument();
doc.replaceItemValue("IDList", IDList);

var agent:NotesAgent=database.getAgent("SomeAgent");
agent.runWithDocumentContext(doc);



回答2:


Perfect! This is exactly what I need:

var IDs = dojo.query(".xspFirstCell > input:checked").attr('value');



来源:https://stackoverflow.com/questions/28882772/how-to-get-marked-rows-in-the-xpages-extension-library-xedataview-design-elem

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