Tolbxela
Tolbxela

Reputation: 5183

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

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!

Upvotes: 0

Views: 213

Answers (2)

Serdar Basegmez
Serdar Basegmez

Reputation: 3355

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

Upvotes: 2

Tolbxela
Tolbxela

Reputation: 5183

Perfect! This is exactly what I need:

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

Upvotes: 0

Related Questions