cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle the custom popup buttons

Former Member
0 Kudos

Hi ,

1. I need to handle the popup buttons in the custom popup.

I have declared the button enabling functionality in wddoinit , but while i am acessng the button no action is performed.

even though i have implemented the following actioncode for ok and cancel .

DATA: lv_ok TYPE string,

lv_cancel TYPE string,

lv_view TYPE REF TO if_wd_view_controller.

lv_view = wd_this->wd_get_api( ).

  • register button events

lv_ok = cl_wd_utilities=>get_otr_text_by_alias( alias = 'PAOC_RCF_UI/OK' ).

wd_comp_controller->go_window->subscribe_to_button_event(

button = if_wd_window=>co_button_ok

button_text = lv_ok

action_name = 'OK'

action_view = lv_view

).

lv_cancel = cl_wd_utilities=>get_otr_text_by_alias( alias = 'PAOC_RCF_UI/CANCEL' ).

wd_comp_controller->go_window->subscribe_to_button_event(

button = if_wd_window=>co_button_cancel

button_text = lv_cancel

action_name = 'CANCEL'

action_view = lv_view

).

Edited by: Swetha Chevuru on Nov 17, 2011 2:29 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Your registration of the button events looks correct. Are you sure that go_window isn't getting recreated at some later time? Recreating the object instead of just calling the display method will cause the event registrations to be reset.

Former Member
0 Kudos

thank you very much your quick reply,

DATA LV_VIEW TYPE REF TO IF_WD_VIEW_CONTROLLER.

LV_VIEW = wd_this->wd_get_api( ).

In the above code in LV_VIEW action table is not getting filled.

may be this is the reason why my custom method is not triggering for the pop up ok button.

Thank you.

Former Member
0 Kudos

Do u have the actions OK and CANCEL in this view ?

GauravKoundal
Explorer
0 Kudos

Hi Swetha

Use this Code in your WDDOINIT and then ONACTIONYES write the action that you want to perform.

data:

l_api type ref to if_wd_view_controller,

l_window_ctlr type ref to if_wd_window_controller,

l_popup type ref to if_wd_window.

l_api = wd_this->wd_get_api( ).

l_window_ctlr = l_api->get_embedding_window_ctlr( ).

if l_window_ctlr is bound.

l_popup = l_window_ctlr->get_window( ).

if l_popup is bound.

l_popup->subscribe_to_button_event(

button = if_wd_window=>co_button_yes

button_text = 'Yes' "#EC *

action_name = 'YES'

action_view = l_api

is_default_button = abap_true ).

endif.

endif.