cancel
Showing results for 
Search instead for 
Did you mean: 

Check box In table

Former Member
0 Kudos

Hi,

I need to create check box as a column in a table employees,On selecting the check box. the entire row shld get selected and display the form details of that particular employee,in the below details how can i do that.?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jenifer,

Please make use of below link.

https://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproABAP-UsingUIelementsinALVcomponentcells

Refer this as well :

Thanks,

Prashant

Answers (3)

Answers (3)

gill367
Active Contributor
0 Kudos

is it a client requirement to put the check box in the table otherwise without putting the check box also you can select teh row

by using the lead select of the table.

anyways if you still want the checkbox in the table on selcting which you want to show the details of the selected row.

then you can add one boolean attribute to the node which you will bind to the table UI

and then use create binding as suggested above.

after that for the check box you will haev one event called 'ontoggle'

there write the following code.

DATA lo_nd_details TYPE REF TO if_wd_context_node.
    DATA lo_el_details TYPE REF TO if_wd_context_element.
    DATA ls_details TYPE wd_this->element_details.
*   navigate from <CONTEXT> to <DETAILS> via lead selection
    lo_nd_details = wd_context->get_child_node( name = wd_this->wdctx_details ). " here replace details with the nam eof your node

*   @TODO handle not set lead selection
    IF lo_nd_details IS INITIAL.
    ENDIF.

     DATA: lr_element TYPE REF TO if_wd_context_element,
  lv_index_table TYPE i,
  lv_index TYPE i,
  wd_node TYPE REF TO if_wd_context_node.
 lr_element = wdevent->get_context_element(  'CONTEXT_ELEMENT' ).
 lv_index_table = lr_element->get_index( ).

   lo_nd_details->set_lead_selection_index( index = lv_index_table ).
*   get element via lead selection
    lo_el_details = lo_nd_details->get_element(  ).

then using the selcted elements you can fetch the details and display it.

thanks

sarbjeet singh

sahai
Contributor
0 Kudos

hi jenifer,

you can add the checkbox as guided above..

now whenever you click on the checkbox the value will be accepted as 'X' or ' ' .....you can check the value using debugger ...and accordingly place your logic using IF ...Else...ENDIF....in your code which will help you populating the values according to the selected checkbox...

in case of further difficulty inform ..

thanks and regards,

sahai.s

Former Member
0 Kudos

Hi Jennifer,

Once you have created the Table , follow these steps:

1) Right click on the table UI and select option 'Create Binding'.

2) It will present you with a window , click the context button and choose the desired node.

3) It then shows all the columns with the cell editor as TextView.

4) You can change it to checkbox for desired column.

Please note that the column you are making as checkbox should be of type boolean.

I hope it helps.

Regards,

Sumit