cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve index of a button in a row of a table

Former Member
0 Kudos

Hi,

I have a webdynpro table and have buttons in one of the columns. I need to retrive the index of the row or button on click of the button. How can i do that? Any help

regards,

Sujesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

sujesh,

1. If your Table has no property compatabilityMode (check on UI designer in IDE), then every event occurs on lead selected element, you may get its index in action event handler like:

wdContext.node<NameOfNodeThatIsTableDataSource>().getLeadSelection();

2. Otherwise add parameter "row" of Java type IWDNodeElement to action, then add following to wdDoModifyView:


if (firstTime) {
  final IWDButton btn = (IWDButton)view.getElement("id-of-button");
  btn.mappingOfOnAction().addSourceMapping("nodeElement", "row");
}

Then in action event handler you may just use row.index();

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

Thanks Valery...

I took second approach!

It works perfect!

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

Try this,

Create a node element in the node.And bind the number of row to the element.At runtime you can get the number by retriving the lead selection method.

int num=wdContext.current<Tablenode>Element().get<NUmberParam>();

Kind Regards

Mukehs