cancel
Showing results for 
Search instead for 
Did you mean: 

Problem about table!!

Former Member
0 Kudos

Hi

I create a table and binding a node .I insert a column,and insert tableCellEditor ,insert a LinkToAction.

How can judge which line i choose?

Is there some method to judge?

Best Regards

Yan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

if i am not wrong do you mean which row you selected ?

use the following code to read the selected row.


ITableElement ele=wdContext.nodeTable().getTableElementAt(wdContext.nodeTable().getLeadSelection()); // will return the row element.

ele.get<attribute>(); // to read the attribute value from the corresponding row.

hope it helps you!

Regards,

ramesh

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Yan,

For Example you have node like

1. Table_Node

-> Row_Index_Element

-> EmpId_Element(Link Value)

2. Create Action for EmpId Like

onActionEmp_Details(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.tc.webdynpro.progmodel.api.IWDNodeElement element )

Create one extra parameter in Action "element".

3. write this code in DoModifymethod


IWDLinkToAction link=(IWDLinkToAction)view.getElement("ALL_LinkToAction"); // This is Link Action UI element Name
link.mappingOfOnAction().addSourceMapping("nodeElement", "element"); // Action Parameter

4. Above created action in step 2 write code to get selected(clicked on linktoaction) row values.

 
int row =element.getAttributeAsText("Row_Index_Element");
String emp_id=element.getAttributeAsText("EmpId_Element");

Regards,

Satya

Former Member
0 Kudos

Hi Yan,

Could you please explain what do you want to achieve?

Regards,

Anagha