on 05-31-2010 9:27 AM
Hi all,
I use a table in my WD abap. I have a simple problem : once I've selected a line, I cannot deselect it. Is it a normal behaviour ? I want the user to be able to delesect the line, so that no line of the table is selected.
Here are my settings :
- Context node :
Cardinality : 0..n
Selection : 0..1
Initialization lead selection : blank
Singleton : blank
- Table element :
selectionChangeBehaviour : auto
selectionMode : auto
Thanks for your help.
Hi,
You can check in this Web Dynpro component: WDR_TEST_TABLE
Go to the View 'Selection'. It has everything you want from tables.
If you are still not able to get your solution than revert back.
Regards,
Saud
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Saud, it helped me a lot.
Finally I was forced to add some code to deselect the line. I think it's strange to have to do this, but I don't find any alternative...
Here's the code I put in the ONSELECT action of the table :
DATA : ls_old_ev_param TYPE wdr_event_parameter,
ls_new_ev_param TYPE wdr_event_parameter.
DATA : ls_old_sel TYPE wd_this->element_histo,
ls_new_sel TYPE wd_this->element_histo.
DATA : lo_element TYPE REF TO cl_wdr_context_element.
DATA : lv_index TYPE i.
FIELD-SYMBOLS : <ls_data> TYPE ANY.
DATA : lo_node_table TYPE REF TO if_wd_context_node.
READ TABLE wdevent->parameters
WITH KEY name = 'OLD_LEAD_SELECTION'
INTO ls_old_ev_param.
IF sy-subrc = 0.
ASSIGN ls_old_ev_param-value->* TO <ls_data>.
IF <ls_data> IS NOT INITIAL.
lo_element ?= <ls_data>.
CALL METHOD lo_element->if_wd_context_element~get_static_attributes
IMPORTING
static_attributes = ls_old_sel.
ENDIF.
ENDIF.
READ TABLE wdevent->parameters
WITH KEY name = 'NEW_LEAD_SELECTION'
INTO ls_new_ev_param.
IF sy-subrc = 0.
ASSIGN ls_new_ev_param-value->* TO <ls_data>.
IF <ls_data> IS NOT INITIAL.
lo_element ?= <ls_data>.
CALL METHOD lo_element->if_wd_context_element~get_static_attributes
IMPORTING
static_attributes = ls_new_sel.
ENDIF.
ENDIF.
*** Same selection -> deselection
IF ls_old_sel-objid = ls_new_sel-objid.
lo_node_table = wd_context->get_child_node( 'HISTO' ).
CALL METHOD lo_element->if_wd_context_element~get_index
RECEIVING
my_index = lv_index.
CALL METHOD lo_node_table->set_selected
EXPORTING
flag = abap_false
index = lv_index.
lo_node_table->set_lead_selection_index( lo_node_table->no_selection ).
ENDIF.
Edited by: Julien999 on May 31, 2010 3:56 PM
Hi Julien,
you can select/delesect the table row by changing the selection mode to Single instead of auto. Hope it works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.