cancel
Showing results for 
Search instead for 
Did you mean: 

Link to Action in table cell in WDA

former_member184578
Active Contributor
0 Kudos

Dear Experts,

I am working on web dynpro application where i created a normal table .

I am displaying selected row details in one container.. For this i write the code in OnLeadSelection event . But i want to display

the details when clicks on link in table cell instead of OnLeadSelection.

Any ideas ll be appreciated..

Thanks in Advance,

Kind Regards

kiran

Accepted Solutions (1)

Accepted Solutions (1)

former_member185879
Active Contributor
0 Kudos

Hello Kiran,

It is possible, we need trigger an event atleast like leadselection, or insteading of lead selection remove the lead selection and provide the check box for all the rows, on select of the check box display the values or place an input field and make it as read only then ask user to press enter on that particular field. But dont forget to write your implementation on OnEnter action of inputfield.

ya, as he said, even it is possible by placing linktoAction also. no issues. I messed up with the question you asked and provided answers. now i have corrected.

hope it helps. Revert for any clarification.

Regards

Nizamudeen SM

Edited by: Nizamudeen SM on Jan 11, 2011 7:09 AM

former_member184578
Active Contributor
0 Kudos

Hi Nizamuddin,

How to Provide check box instead of lead selection..!! Can U pls tel I m a newbie to web dynpro abap..

Thank You

Regards,

Kiran

former_member185879
Active Contributor
0 Kudos

Hello Kiran,

1. How many rows are there in the table?

2. What is the value for the property Compatability Model in the table? It should be auto. (It is in Webdynpro JAVA)

3. wdContext.currentTableNodeElement().getName(); it will give you the current value on whichever row you have clicked.

And for check box

Place a new column and name it as Select. on that place CheckBox Ui. you need bind a boolean attribute for the check and it should inside the table node. on click action, write the code to check which element is selected by checking this attribute is true or not. Using that get the index of that element and process accordingly.

Try the following for WD ABAP.

Regards

Nizamudeen SM

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Kiran,

You can achive this by means of Parameter mapping for the link to action UI you are using, below are the steps

1. For the onAction method of the Link to Action UI add an input parameter selectedElement of type IWDNodeElement.

2. Add the below mentioned code in the wdDoModify() method, assuming "la_Link" is the Id of the Link to Action UI added in the table cell


if(firstTime){
     IWDLinkToAction link = (IWDLinkToAction) view.getElement("la_Link");              
     link .mappingOfOnAction().addSourceMapping("nodeElement","selectedElement");
}

3. In the onAction method of the Link to Action UI use the below line of code to get the selected row, using which you can get the corresponding values


IPrivate<VeiwName>.I<TableNodeElement> element = (IPrivate<VeiwName>.I<TableNodeElement>) selectedElement;

Hope this will help.

Regards,

Vishweshwara P.K.M

Hey sorry, I did not see the subject line properly, this answer was for web Dynpro JAVA

Edited by: Vishweshwara P.K.M on Jan 12, 2011 6:06 AM

0 Kudos

Hi kiran,

romove the action asiigned to onLeadSelection and create LinkToAction UI element in Table cell editor and assign newly created action to LinkToAction UI element.

in that action first get the leadselection fo table by using getLeadselection() method.

get the values from that row based on lead selection and set to the container fields.

revert back if you any quaries.

Thanks & Regards,

Bhargava.

former_member184578
Active Contributor
0 Kudos

Dear All Thanks for ur replies.. I rewarded to all .. all r helpful answers.. but still i m not getting that..!!

@ Bhargava & Abhinav ,

Hi Bhargava & Abhinav ,

I did the same as u told. default 1st row is selected.. when i click on any link in table cell i am getting the first row values only..!!

Sry I didnt get that.. Can u pls provide one sample piece of code for that..!!

Thanks,

waiting for ur replies..

Regards

kiran

0 Kudos

Hi Kiran,

it is very simple.

1. By defult first row will be select, if you don't want that use the following code in wdDoInint() method.

wdContext.node<NodeName>().setLeadselection(-1);

2. Place the LinkToAction UI element in Table cell editor and create the action for that.

3. In Action write the following code.

if for example in table LInk, EmpId, name and Empstatus columns are there.

IPrivateAPPlinktestView.ITableNode node = wdContext.nodeTable();

IPrivateAPPlinktestView.ITableElement ele;

if(node.getLeadSelection() != -1)

{

ele = node.getTableElementAt(node.getLeadSelection());

wdContext.currentFormElement().setEmplid(ele.getEmplid());

wdContext.currentFormElement().setName(ele.getName());

wdContext.currentFormElement().setEmpstatus(ele.getEmpstatus());

}

revert back if you have any quaies.

Thanks & Regards,

Bhargava.

Abhinav_Sharma
Contributor
0 Kudos

Hi

If I understood you correct, you want to display certain rows on click of link to action instead of OnLeadSelection. I think this is possible and whatever code you have written, you cam write the same in onAction of Link. And dont write anything on onLeadSeclection.

Once you click on your link to action, by default onLeadSelection will be triggered and if there is no code, next action will be called which is your link to action.

We have tried the same approach and it worked for us.

Regards

Abhinav Sharma