cancel
Showing results for 
Search instead for 
Did you mean: 

WD For ABAP : cl_wd_table HELP?

0 Kudos

Hi:

I have a problem to solve about web dynpro for abap.

I create a table and the first column is a LINK_TO_BUTTON(Function LIKE BBS),if there are 6 rows data ,when i click the link_to_button of 1 row in 6,I want to konw which row i have clicked ,

so,how to do it? wish to give me some advice.

Thanks in advance.

Edited by: gmasfk on Apr 15, 2009 4:56 AM

Accepted Solutions (1)

Accepted Solutions (1)

former_member40425
Contributor
0 Kudos

Hi,

Use can put following code in the ONACTION of LINK_TO_BUTTON.



method ONACTIONONLINKTOBUTTON .
  data: lr_element type ref to if_wd_context_element,
          lv_index type i.
 
  lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT'  ).
  lv_index = lr_element->get_index( ).

Now lv_index will contain the table row number in which the button was triggered.

I hope it helps.

Regards,

Rohit

0 Kudos

HI ROHIT:

Thanks for your code.

It's OK ,now.

And,Thanks again.

Kind regards..

gmasfk.

Answers (2)

Answers (2)

0 Kudos

Hi ALEX:

Thanks for your reply,quikily.

I don't understand the ' "pass ui parameters" check box ',where it is?

when i get the name of the element , it always display the first row whether you click any row.

the effect i want to achieve is topic list,when i click current topic ,it will jump to a new window,

the data will be displayed by topic.

I'm Sorry to give you trouble.

kind regards,

gmasfk

Former Member
0 Kudos

hi gmasfk,

when you create an action for the element for the first time, you get a pop up window where you mention the action name, there you will have a check box to transfer ui events, or you can go to the actions tab and click the button present in the last column of the action and change it.... or you can even try getting the lead selection value

---regards,

Alex B Justin

0 Kudos

HI ALEX:

thanks for your advice,I'll try .

kind regards,

gmasfk..

Former Member
0 Kudos

hi,

when you create the action for the link, check the "pass ui parameters" check box. this will give you reference to class cl_wd_event, with which you can get the name of the element and other properties and use it.

---regards,

Alex B Justin