on 07-14-2010 5:33 PM
Hi Experts,
I have a table with 10 columns & 5 rows. I have hyperlink in each row that means I have total 5 hyperlinks.
Now when I click one particular hyperlink in any row I want the index of that particular row(or the row reference) where hyperlink is being clicked.
Please suggest how to get the row index.
Thanking you.
Regards,
Anindita
HI,
Creat a event to handle the event ON_CLICK of SALV_WD_TABLE component then you can use the parameter
R_PARAM->INDEX of the method created to get the index of the selected link element.
example:
* navigate from <CONTEXT> to <ND_ALV_RESULT> via lead selection
lo_nd_nd_alv_result = wd_context->get_child_node( name = wd_this->wdctx_nd_alv_result ).
* alternative access via index
lo_el_nd_alv_result = lo_nd_nd_alv_result->get_element( index = r_param->index ).
* get all declared attributes
lo_el_nd_alv_result->get_static_attributes( IMPORTING static_attributes = ls_nd_alv_result ).
Regards,
Fabio Saito
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
when the link to action is clicked,
you can get the corresponding context element in the event handler of the action for Link to Action.
method ONACTIONREAD .
DATA ele TYPE REF TO IF_WD_CONTEXT_ELEMENT.
DATA index TYPE i.
ele = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
i = ele->get_index( ).
endmethod.
In the above code, ele will have the reference to the context element corresponding to the link to action which was clicked.
and you get the index of that element using get_index( ) method.
Hope this helps!
Regards,
Srilatha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use the method of get_Index from if_wd_content_element.
DATA: lo_el_node TYPE REF TO if_wd_context_element.
DATA: lv_index TYPE i.
lo_el_node = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
lv_index= lo_el_node->get_index( ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.