on 2009 Sep 02 6:04 PM
Hei,
I need to select the row once i click on the box on the left most side of the row. I am able to do that if i don't have a event defined. But i need to define event. Hence i am not able to select the row by clicking that button.
So i wrote the following code once i click that box and it goes into the event i have defined.
DATA lr_element TYPE REF TO if_wd_context_element.
DATA lv_index TYPE i.
DATA l_node TYPE REF TO if_wd_context_node.
" get the index of the cell
lr_element = i_event->get_context_element('CONTEXT_ELEMENT').
lv_index = lr_element->get_index( ).
But the problem is that, lr_element, is initial and hence i get a dump.
How would i programmatically select that row when i click on the box on the far left a row? Or maybe their is a table setting which i can use to make it select everytime i click on that box eventhough i have a onSelect event defined?
Any help will be appreciated.
Thanks
Request clarification before answering.
Hi,
the code which you are using is not for the functionality you want. This code helps when you have inserted any UI like buttun or linktourl in your table and if you click on that button then you get the index of the row.
For your functionality write the following code.
wd_node = wd_context->get_child_node( name = 'NODE_NAME' )." Here NODE_NAME is name of your context node which is binded to table
lr_element = wd_node->get_lead_selection( ).
I hope it helps.
Regards,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try using following code.
DATA lo_nd_<Node_Name>TYPE REF TO if_wd_context_node.
DATA lo_el_<Node_Name>TYPE REF TO if_wd_context_element.
DATA ls_<Node_Name>TYPE wd_this->element_<Node_Name>.
DATA lt_<Node_Name>TYPE wd_this->elements_<Node_Name>.
lo_nd_<Node_Name>= wd_context->get_child_node( name = wd_this->wdctx_<Node_Name>).
lo_el_<Node_Name>= lo_nd_<Node_Name>->get_lead_selection( ).
I hope it helps.
Regards,
Rohit
Not sure exactly if i understand.. maybe this can help
get access to the desired context node - single selection
wd_node = wd_context->get_child_node( name = 'LIST_FPS' ).
lr_element = wd_node->get_lead_selection( ).
OR
get multible selection
lo_nd_list_fps = wd_context->get_child_node( name = wd_this->wdctx_list_fps ).
lt_elements = lo_nd_list_fps->get_selected_elements( ).
are you using an ALV table?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
30 | |
9 | |
8 | |
7 | |
7 | |
6 | |
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.