on 04-14-2008 11:21 AM
HI Experts,
I have a table in which I have set one perticular column (column name-->Business Unit)as link to action.This column has 25 records.So all the 25 records for this perticular column are HYPERLINK.I have written an onAction for this link to action.
My Problem:-I want to get which perticular link i have clicked.
Means out of 25 records(hyperlinked) in that perticular column column,I want to know which perticular record(or which perticular hyperlink) I have click.
I want to get that percular record,so that i can use that information .
All my coding are dynamic.
Please suggest me with some sample code.
Sample code will be very helpful.
Regards-
Sandip
Hi,
map a parameter of type IWDNodeElement nodeElement for your action handler
Use the following code in the wdDoModify to map this
if(firstTime)
{
IWDLinkToAction linkToAction =(IWDLinkToAction)view.getElement("action");
linkToAction.mappingOfOnAction().addSourceMapping("nodeElement", "nodeElement");
}
Now your action handler should look like
public void onActionActionLink(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.tc.webdynpro.progmodel.api.IWDNodeElement nodeElement )
{
//@@begin onActionActionLink(ServerEvent)
nodeElement.getAttributeValue(attributeName);
//Using the nodeElement you can access all the context attributes of the clicked link.
//@@end
}
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandeep,
Create an action and bind it to link to action.
In this action write code like this to find particular record(or which particular hyperlink) I have clicked.
String currBusUnit = wdContext.node<tablenode>().current<tablenode>Element().get<attribname>();
you can use currBusUnit for your computation.
regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandip,
you can use getTreeSelcection method of the table for reading the selected row.
Code is as followed, here DeviceElement is the Value node that is binded to table:
IPrivateForm_View.IDeviceElement selnode;
int dev_no = wdContext.nodeDevice().size();
for (int i = 0; i < dev_no; i++)
{
selnode = wdContext.nodeDevice().getDeviceElementAt(i);
int empid = selnode.getEmpId();
}
In the empid variable, selected Emplyee Number will come.
Hope this helps you.
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.