Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9159

Button to select all at checkbox table column

$
0
0

Hi all,

 

I'm building a screen where I have a table with 2 columns, textview at column 1 and checkbox at column 2.

I need to create a button for a "select all" action. This button should select all checkboxes on the table.

Currently my button is working only for the first row of the column as you can see below.

 

Could anyone help me on this? Thank you!

 

checkbox.png

 

Code for button action:

 

METHOD onactionselect_all .

 

   DATA lo_el_unid_org TYPE REF TO if_wd_context_element.

   DATA: lo_nd_unid_org TYPE REF TO if_wd_context_node,

         lines_count TYPE i VALUE 0.

   DATA check TYPE string.

 

   check = 'X'.

 

   lo_nd_unid_org = wd_context->get_child_node( name = 'UNID_ORG' ).

*  lo_nd_unid_org = wd_context->path_get_node( path = 'UNID_ORG' ).

 

   lo_el_unid_org = lo_nd_unid_org->get_element( ).

 

 

   CALL METHOD lo_nd_unid_org->get_element_count

     RECEIVING

       count = lines_count.

 

   DO lines_count TIMES.

 

*    lo_nd_unid_org->set_selected( flag  = 'X'

*                           index = sy-index ).

 

     check = 'X'.

 

     lo_el_unid_org->set_attribute(

          EXPORTING

            name `MARC`

            value = check ).

 

   ENDDO.

 

 

ENDMETHOD.


Viewing all articles
Browse latest Browse all 9159

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>