cancel
Showing results for 
Search instead for 
Did you mean: 

Value of LinkTOAction Ui element (under master column)

Former Member
0 Kudos

Hi,

I have a table with the first column as TableByindexColumn(master column). I have made the tableEditor of master column as type "LinkTOaction". When we click on it, it will trigger a event to call another screen. The Heading of this “linkToAction” will vary and are dependant on the mapped context.

The screen table will look something like this

(master column) (table column)

TDN Number equipment

151886

. Bomester

. AutoBOx Half Size

151003

. Cage Half Size

Now, if i click on link 151886 or 151003, it should popup another screen with the details of this TDN number. For Doing this, I need the tdn number which is selected. But Though it is inside a table, when I expand a click on the link, the row wont get selected and lead selection wont work. Link to action also doesn’t have any method to get the selected Link if it is nothing lead selection.

Please guide me on how to get the mapped value of “linkToAction” on click of it.

Regards,

-Shabir Rahim.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Ayyapparaj,

I opened the layout tab of the view and the outline screen was opened on the bottom left of nwds. I went to Master column having the "LinkToAction" uiElement. But when i right click on this ui element, I couldn't see any option called "Parameter mapping". Can you tell me where to find this option in outline screen

Regards,

-Shabir Rahim

Former Member
0 Kudos

Hi,

No probs,

You can write the following code in the Wdmodify of your view, both does the same.

IWDLinkToAction linkToAction = (IWDLinkToAction)view.getElement("<Your Link to Action UI element");

linkToAction.mappingOfOnAction().addSourceMapping("nodeElement", "nodeElement");

addSourceMapping(sourceName,newName);

Details of the params

sourceName

name of the parameter in the mapping source object

newName

name of the parameter after mappingRegards

Ayyapparaj

Former Member
0 Kudos

Hi,

Create an Event for onAction of the Link to Action. lets say "myaction"

Create an action parameter lets say "nodeElement" of type IWDNodeElement or I<YourNode>Element.

Your action should look as follows

public void onActionMyaction(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.tc.webdynpro.progmodel.api.IWDNodeElement nodeElement )

{

//@@begin onActionMyaction(ServerEvent)

//@@end

}

Go to OutLine View

RightClick on the link to action

Select Parameter mapping

Map the nodeelement from right to left.

From the code you can access the current element using

nodeElement.getAttributeValue(attributeName)

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

Try this:

1. In wdDoModifyView():

IWDLinkToAction link = (IWDLinkToAction) view.getElement(<ID of the link UI element>);

link.mappingOfOnAction().addParameter("tdnNumber",wdContext.<node attribute mapped to link title>);

2. Declare the action handler with one parameter of type String:

public void onLinkAction (IWDCustomEvent wdEvent , String tdnNumber )
{
   //Here you have the tdnNumber as a String...
}

Regards,

Satyajit.