cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve content of a cell table.

Former Member
0 Kudos

If the column of a table is declared 'Link to action', when I push onto a specific cell of that column, how can I get the content of the clicked cell?

Thanks for answer.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Avalor,

Did you get any solution to this problem. I am also facing the same problem and could not find any OSS note regarding this.

Thanks,

Vikas

anand_nidamanuru
Active Participant
0 Kudos

Hi Avalor,

Are you sure you are using the context element from the PARAMETERS OF THE ACTION HANDLER???

Or you are using node->get_element?

Thanks,

Anand

Former Member
0 Kudos

In abap code please.

thomas_szcs
Active Contributor
0 Kudos

Hi Avalor,

Just define a parameter CONTEXT_ELEMENT of type IF_WD_CONTEXT_ELEMENT at the signature of the action handler. This points to the current row of the table.

In order to read the value of an attribute just write as usual:


context_element->get_attribute( exporting name = ... importing value = ... ).

Best regards,

Thomas

Former Member
0 Kudos

I've already done that, it returns the value of the cell in the row with the lead selection, none the value of the specific cell where i clicked (that stays in a different row than the row with lead selection).

thomas_szcs
Active Contributor
0 Kudos

Hi Avalor,

This is strange. Are you really certain? Do you really use the predefined parameter context_element without calling any method like get_lead_selection, etc? I am asking, because this is a core feature of WDA and many, many applications rely on it to function properly and there are no known issues atm. If you still believe the leadSelection is used instead of the current row (after checking all of the above), please don't hesitate to create an oss ticket.

Best regards,

Thomas

Former Member
0 Kudos

Define an event parameter mapping, either in the NWDS (if possible), or by code:


wdDoModifyView(...)
if (firstTime)
{
  IWDLinkToAction link = (IWDLinkToAction) view.getElement("ID-of-link");
  link.mappingOfOnAction.addSourceMapping
  (
    "nodeElement", /* event parameter name */
    "selectedRow" /* action parameter name */
  );
}

Add parameter "selectedRow" to the action assigned to the link. You can define its type either as IWDNodeElement and cast inside action or use I<Node>Element, where <Node> is the table's data source node.

Armin