cancel
Showing results for 
Search instead for 
Did you mean: 

Button on atable

Former Member
0 Kudos

Hi Experts,

I am displaying the column of Table UI element as Button. Now, I want to perform some functionality/Action when the

user click on the button. How to handle this type scenario?

Thanks in advance,

Sreenivas

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Answered

Former Member
0 Kudos

Hello Sreenivas,

I am not sure why you want to have a column full of buttons.

You could simply select a row of the table and have a button separately.

Thanks

Anurag Chopra

Former Member
0 Kudos

Hello,

Create an action handler for the onAction event of table cell editor in that TABLE column. And in that action handler, you can get the corresponding context element of the button which is clicked using the following syntax:


DATA ele TYPE REF TO IF_WD_CONTEXT_ELEMENT.

ele = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).

So with that information, you can perform anything that you wish.

Hope this helps!

Regards,

Srilatha

Former Member
0 Kudos

Thanks a lot Srilatha, I could solve my issue...

Former Member
0 Kudos

Hello Sreenivas,

If your issue is solved, please mark the thread as answered.

Regards,

Srilatha

Former Member
0 Kudos

The below scenario is to open a new window on click of the button. A View with the details is created and is added to a Window. On click of the button, I am opening that window.

DATA lo_window_manager TYPE REF TO if_wd_window_manager.
    DATA lo_api_component  TYPE REF TO if_wd_component.
    DATA lo_window         TYPE REF TO if_wd_window.
    DATA l_api             TYPE REF TO if_wd_view_controller.

    lo_api_component  = wd_comp_controller->wd_get_api( ).
    lo_window_manager = lo_api_component->get_window_manager( ).
    lo_window         = lo_window_manager->create_window(
                window_name            = 'Window Name'
               title                  = 'Title of the Window'
*           close_in_any_case      = abap_true
*            message_display_mode   = if_wd_window=>CO_MSG_DISPLAY_MODE_NONE
*           close_button           = abap_true
*            button_kind            = if_wd_window=>CO_BUTTONS_OKCANCEL
                message_type           = if_wd_window=>co_msg_type_none
                default_button         = if_wd_window=>co_button_cancel
                 ).

    wd_comp_controller->go_window = lo_window.

    lo_window->open( ).