You have several options here. First option:
wdContext.node<YourNode>.getLeadSelection().index();
Pay attention to get lead selection of your node but not of the root context. Also context mapping should be properly defined for this to work.
Second option is to use wdDoModifyView event:
wdDoModifyView(...)
{
if (firstTime)
{
IWDLinkToAction link = (IWDLinkToAction) view.getElement("LinkID");
link.mappingOfOnAction().addSourceMapping("nodeElement", "rowElement");
}
}
Here we map built-in parameter nodeElement
to our target rowElemen
parameter which would be used in LinkToAction handler.
void onActionLinkClicked(..., I<DataSourceNode>Element rowElement)
{
/* do whatever with row element */
}