cancel
Showing results for 
Search instead for 
Did you mean: 

Multi Selection

Former Member
0 Kudos

Hello,

I have a value node with a selection property of 0..n

in my context.

Because of this it's possible to have a multi-select.

But I don't know how to get all selected items

in my Source Code.

For a single selection I know this statement:

wdThis.wdGetContext().nodeSelectionPersons().getLeadSelection();

But how can I get all selections in a multi-selection.

Patrick

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Patrick,

Try this code snippet. It should be self-explanatory.

final IWDNode node 
  = wdContext().nodeSelectionPersons();

final int lead = node.getLeadSelection();
for (int i = 0, count = node.size(); i < count; i++)
{
   if ( i == lead || <b>node.isMultiSelected(i)</b> )
   {
      wdComponentAPI.getMessageManager().reportSuccess
      (
         "Element is selcted (lead or multi): " + i
      )
   }  
}

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com