cancel
Showing results for 
Search instead for 
Did you mean: 

Select row when button in table is clicked

Former Member
0 Kudos

Hi Experts,

In my webdynpro application, I am using a table control. One of my columns contain buttons. When the user clicks a button an event is triggered. I want to know which row the button was clicked on. The lead selection value always shows the first row.

Can anyone help me solve this issue.

Regards,

Abdullah

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Remove the Lead selection of your Context node and then write the below code at your Button event handler.

DATA : INDEX TYPE I.

CALL METHOD node_sbook->get_lead_selection_index
  receiving
    index  = INDEX.

But the problem is first you have to selectany row of your table and then click the corresponding button means it will find the Index of the table.

Thanks.

Former Member
0 Kudos

Hi Viji,

I want to get the index without selecting the row. The end users are very naive in IT know how. I have to make it as simple as possible.

Alex, how do I proceed after getting the set. How do I find out on which row the button was clicked on.

Any other ideas are also welcome.

Regards,

Abdullah

Former Member
0 Kudos

Hi,

Let me put it in this way. I have four columns.

1. Column 1 has the service order number.

2. Column 2 has the task number

3. Column 3 has the description

4. Column 4 has the status button -

I want to know the row number when the user clicks on any of the button in column 4. Or that row should get selected. It always shows the first row as selected.

Any suggestions on how to go about it.

Regards,

Abdullah Ismail

Former Member
0 Kudos

Hi,

I used the parameter, WDEVENT to determine the row.


element_button = wdevent->get_context_element( name = `CONTEXT_ELEMENT` ).

element_button->get_static_attributes( importing static_attributes = wa_operations ).

I get all the attributes of the table row where the event occurred in my work area wa_operations.

Regards,

Abdullah

Former Member
0 Kudos

hi abdullah.....

try using the get_selected_elements method of the interface if_wd_context_node.

---regards,

alex b justin