on 02-23-2014 10:13 PM
Hiya,
I have a screen where the first row is always selected:
Is there any way to switch this off i.e. I'd still like the user to select a row but I don't want the screen to start with a row already selected.
Also once a user selects a row - how would I know which row the user has selected and then process only the details of that row?
Thanks for any help!
Hi Robert,
You can achieve your requirement as below
DATA lo_ctx_element TYPE REF TO if_wd_context_element.
data ls_data TYPE wd_this->element_node_name.
"get the selected element
lo_ctx_element = wdevent->get_context_element( name =
'NEW_ROW_ELEMENT' ).
IF lo_ctx_element IS NOT BOUND.
RETURN.
ENDIF.
" get the data of selected row
lo_ctx_element->get_static_attributes(
IMPORTING
static_attributes = ls_data
).
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robert,
1. To unselect row by default, Un check propertie 'Intialization of the node' of the node. so the row of the table will not be selected by default
2. if you want to read or fetch the data of the selected row
a. create an action to the event 'ONLEADSELECT' of a table and write the following logic
DATA: lo_nd_table type ref to if_wd_context_node,
lo_el_table type ref to if_wd_context_element,
ls_table type wd_this->element_table.
lo_nd_table = wd_context->get_child_node( 'TABLE' ).
if lo_nd_table is not initial.
lo_el_table = lo_nd_table->get_element( ).
if lo_el_table is not initial.
lo_el_table->get_static_attributes( importing static_attributes = ls_table ).
endif.
endif.
Note: Ls_table will return the data of the selected row
b. if you need to read or fetch the selected record of a row ( on action of a button or link )
DATA: lo_nd_table type ref to if_wd_context_node,
lo_el_table type ref to if_wd_context_element,
ls_table type wd_this->element_table.
lo_nd_table = wd_context->get_child_node( 'TABLE' ).
if lo_nd_table is not initial.
lo_el_table = wdevent->get_context_element( 'CONTEXT_ELEMENT' ). " This will return the selected row
if lo_el_table is not initial.
lo_el_table->get_static_attributes( importing static_attributes = ls_table ).
endif.
endif.
Note: wdevent->get_context_element( 'CONTEXT_ELEMENT' ). This will return the data of the lead selection ( eg: Tree ) or particular row data of a table when button or link is clicked.
Hope this should help you
Thanks & Regards,
Sankar Gelivi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
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.