on 09-21-2007 4:09 PM
I just have a button on each line for DETAILS
I'd like to identify the row on which the button was pressed so that I can read an internal table to get the corresponding record!
so far i'm there...
DATA:
L_INDEX TYPE I.
DATA:
NODE_OBJECT_LIST TYPE REF TO IF_WD_CONTEXT_NODE,
ELEM_OBJECT_LIST TYPE REF TO IF_WD_CONTEXT_ELEMENT,
LWT_SELECTION TYPE WD_THIS->ELEMENT_SELECTION.
* navigate from <CONTEXT> to <OBJECT_LIST> via lead selection
ELEM_OBJECT_LIST = wdevent->get_context_element('CONTEXT_ELEMENT').
Stephan, I misunderstand your need
You have a button on EACH row of the table. When the button is pressed, you need to get the line of the table in which your button is. In this case, you can add a new import parameter to the method of the button action, with TYPE REF TO IF_WD_CONTEXT_ELEMENT. Let's call it "element". In your method, you just call the same get_index of the element:
lv_index = element->get_index( ).
Hope it helps!
Andre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Stephan,
Suppose you have a NODE called DETAILS in your view VIEW. In the button action, add the following code to get the index of the selected element:
DATA: node_details TYPE REF TO if_wd_context_node,
elem_details TYPE REF TO if_wd_context_element,
lv_index TYPE i.
node_details = wd_context->get_child_node( name = 'DETAILS' ).
IF ( node_details IS INITIAL ).
EXIT.
ENDIF.
elem_details = node_details->get_element( ).
IF ( elem_details IS INITIAL ).
EXIT.
ENDIF.
lv_index = elem_details->get_index( ).
Regards,
Andre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.