cancel
Showing results for 
Search instead for 
Did you mean: 

Link between event handle and added button

Former Member
0 Kudos

Hi All,

I add the attribute 'GT_BUTTON' in the class and a button in DO_PREPARE_OUTPUT. Also do the coding in BSP. Now I could see the added button in the Web UI. Then the next step is to add logic when we click on it. So I create the event handle, but I don't know how to link the created event handle with the added button. Could anyone give me any hints. Thank you so much.

BR

Jay

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi All,

Here is the details.

in the DO_PREPARE_OUTPUT:

   DATA: ls_button TYPE crmt_thtmlb_button.
   IF gt_button IS INITIAL.
     ls_button-text  = 'COPY'.
     ls_button-enabled = abap_true.
     ls_button-on_click = 'COPY'.
     APPEND ls_button TO gt_button.
   ENDIF.

   typed_context->result->build_table( ).


In the event handle, I created event handle named 'COPY' and then 'EH_ONCOPY' generated.


In the Htm


<chtmlb:tableExtension tableId = "Table"
                        layout  = "FIXED" >
   <chtmlb:configTable id                    = "Table"
                       navigationMode        = "BYPAGE"
                       onRowSelection        = "<%= lv_select_event %>"
                       selectionMode         = "<%= lv_select_mode %>"
                       selectedRowIndex      = "<%= RESULT->SELECTED_INDEX %>"
                       selectedRowIndexTable = "<%= RESULT->SELECTION_TAB %>"
                       table                 = "//RESULT/Table"
                       usage                 = "SEARCHRESULT"
                       actions         = "<%= controller->gt_button %>"
                       visibleRowCount       = "<%= lv_lines %>"
                       downloadToExcel       = "FALSE"
                       width                 = "100%"
                       showNoMatchText       = "FALSE"
                       />
</chtmlb:tableExtension>

Former Member
0 Kudos

Hi All,

I find the issue.  ls_button-on_click = 'copy'. Here I need to use lower case. Thank you.

Answers (0)