Select multiple rows in table without using Ctrl key.
1) 1) Create a table in view. Bind it with the context node.
2) 2) Write code in WDDOINIT to populate the table with data. Wizard can be used for the same.
3) 3) For multiple selection Please select the node properties as below
sfs
1) 4)Set the below two properties of table.
selectionChangeBehaviour as manual and selectionMode as Multi.
5) Implement the action Onselect.
While creating the action doesn’t forget to select the check box “”Copy UI Event Parameters”
1) 6) Implement below code in on_select action
DATA : lv_index TYPE i, “Index of the selected row.
lo_node TYPE REF TO if_wd_context_node. “Conext Node
*New_lead_selection will come automatically once you select* “Copy UI Event Parameters” while creating action
*Get the index of the selected row
lv_index = new_lead_selection->get_index( ).
*Get the referance for Node
lo_node = NEW_LEAD_SELECTION->get_node( ).
*If row is already selectd for that particular index*then unselect that row else select that row
IF lo_node->is_selected( index = lv_index ) = abap_true.
lo_node->set_selected( flag = abap_false index = lv_index ). ” Deselect
ELSE.
lo_node->set_selected( index = lv_index ). ” Select
ENDIF.
7) Output
1
Isn't this the same explained in this document already? http://scn.sap.com/docs/DOC-28915
Dear Kiran,
Thanks for your review comments, but the step 4 (Set the below two properties of table.) was missing in the document which you have mentioned.
Regards
Sachin
😎 Great!!
The key point is selectionChangeBehaviour as manual