Skip to Content
avatar image
Former Member

Link between event handle and added button

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Oct 21, 2015 at 08:27 AM

    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>

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi All,

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