on 05-04-2009 6:48 AM
Hello,
I am using table control in my application. In this table there is one column has button. While pressing on perticular button, i want to edit row of that table in which that button has pressed. but i did not know how to get index of that cell.
regards,
Sid.
Hi,
Use the code given below:
method ONACTIONONLINKCLICK .
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( ).
You can also refer this thread:
https://forums.sdn.sap.com/click.jspa?searchID=25609762&messageID=7042255
You'll get the index of the row clicked in lv_index variable.
I hope it helps.
Regards
Arjun
Edited by: Arjun Thakur on May 4, 2009 11:26 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Refer this :
To read Table Index :
DATA: lv_index TYPE i.
lo_el_cn_node = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
lv_index = lo_el_cn_node->get_index( ).
Now you have index of selected row in lv_index and now you can proceed with further requirement.
Thanx.
Edited by: Saurav Mago on May 4, 2009 11:34 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create an OnAction event for the button. Now write the following code.
" Create an importing parameter context_element type if_wd_context_node in this event handler method
" get index
l_index = context_element->get_index( ).
" get the contents of that row
context_element->get_static_atributes( importing static_attributes = ls_stru )
" to make this entire row editable
1. You should have the cell editors for columns as input field.
2. Create an attribute in the node that is bound to your table. 'EDITABLE' type boolean
3. Bind this attribute to the *editable* property of the cell editors of your table column.
not to make the row as editable pass abap_true to this attribute as follows:
context_element->set_atrtibute( exporting name = 'EDITABLE'
value = abap_true ).
Regards,
Radhika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.