cancel
Showing results for 
Search instead for 
Did you mean: 

using links in WD table

Former Member
0 Kudos

Hello All,

I have a WD table in which one of the columns is a link(LinkToAction). The data in the column is bound to the view context and is also mapped to an OnAction method.

I would like to extract the value of the link when the user selects the link.

I tried 2 ways:

1)

wdContext.currentListDataElement().getSalesOrderNo();

2)

int i = wdContext.nodeListData().getLeadSelection();
   String val = wdContext.nodeListData().getListDataElementAt(i).getSalesOrderNo();

But for some reason the selection of the link does not change the lead selection of the row in the table. The value returned by the above methods does not correspond to the link selected but returns the value of the Sales Order where the row is selected.

Any ideas what I am doing wrong?

Thanks

Asheesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

To the action assigned to the link, add a parameter "row" of type I<Node>Element, where <Node> is the table's data source node.

Define an event parameter mapping for the implicit "nodeElement" parameter:

Either using the mapping editor or by code:

void wdDoModifyView(...)
{
  if (firstTime)
  {
    IWDLinkToAction link = (IWDLinkToAction) view.getElement("Id-of-link");
    link.mappingOfOnAction().addSourceMapping
    (
      "nodeElement",
      "row"
    )
  }
}

Then the parameter "row" will contain the node element corresponding to the table row of the clicked link.

Armin

Former Member
0 Kudos

Thanks Armin it worked. I did not have to do this in NW 2004 so it must be new to 2004S. Anyway where can I get a list of all the implicit parameters. Also I took the code approach but could you provide details on the mapping editor?

Thanks,

Asheesh

Former Member
0 Kudos

In NW04, the table's lead selection was automatically changed when the link was clicked. But this proved to be a performance problem in some situations.

There is only this "nodeElement" parameter which is implicit. All other event parameters are documented in the Javadoc of the mappingOf<event>() methods and in the new IWD<event> interfaces.

The mapping editor can be accessed via the outline view of the view designer: Right-click on a UI element node and select "Parameter mapping".

Armin

Answers (0)