cancel
Showing results for 
Search instead for 
Did you mean: 

Get lead index by any cell

Former Member
0 Kudos

Dear Experts,

How do i determine the lead index if i click on any cell (Input Field) on any row in the table?

Thanks.

Tee

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Define this attribute context_element of type if_wd_context_element in event handler method parameters.This will hold the lead selection of clicked cell of row.

To retrieve attributes you can use context_element->get_static_attributes( ) to receive the clicked row data.Dont forget to declare the attribute "context_element" (as it is ) in the attributes of event handler method.

Answers (3)

Answers (3)

Former Member
0 Kudos

Arjun,

In reality, i have seen a few example of ABAP webs having the desired ability.

By the way, your suggested way works well ...

Thanks.

Tee

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

If the column doesn't contain an Input Enabled UI element in its editor, then clicking on the cell can change the LeadSelection. Perhaps this is what you observed in other SAP applications. Either that or the other SAP application wasn't Web Dynpro. As described, there is no onClick or onFocus event for InputFields.

Former Member
0 Kudos

Guys,

Cool ... it's working ... but, it's limited to action ONENTER for input field.

I am looking for the clicking into the input field, do you know how to do it?

Thanks.

Tee

arjun_thakur
Active Contributor
0 Kudos

Hi,

As i wrote in my previous post, mouse click does not generate any event and you need some action to be triggered to get the index.

Regards

Arjun

arjun_thakur
Active Contributor
0 Kudos

Hi Fooklin,

To get the index of the row which is selected, you need to trigger some action. Clicking on the input field does not trigger any action. So either you need to put an UI element such as button etc to trigger some action or you can use the ONENTER event of the input field. You the following code to get the index of the row click (but this code should be used in some event handler)


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( ).

I hope it helps.

Regards

Arjun