cancel
Showing results for 
Search instead for 
Did you mean: 

How : Close PopUp after 10 seconds

daniel_rothmund
Participant
0 Kudos

Hello I have a popup with a info text . The popup should close after 10 seconds.

I have create I View in the PopUp with a TimeTrigger and this TimeTrigger fire the Exit Plug of the PopUp window.

but it doesn't work

PopUp Cal :

data: context_node type ref to if_wd_context_node.

data: lr_popup type ref to if_wd_window,

lr_view_controller type ref to if_wd_view_controller.

data: lr_api_comp_controller type ref to if_wd_component,

lr_window_manager type ref to if_wd_window_manager.

lr_api_comp_controller ?= wd_this->wd_get_api( ).

lr_window_manager = lr_api_comp_controller->get_window_manager( ).

lr_popup = lr_window_manager->create_window(

modal = abap_true

window_name = 'W_POPCOUNTER' "Name of the window created in step 2

title = 'Please enter all information'

close_button = abap_true

button_kind = if_wd_window=>CO_BUTTON_OK

message_type = if_wd_window=>co_msg_type_warning

close_in_any_case = abap_false

*MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE

).

lr_popup->open( ).

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi daniel ,

i tried your senario it is working ,

in the time trigger ui mention your time interval in the delay property and add the below piece of code in the time triger action

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( ).
  l_popup       = l_window_ctlr->get_window( ).

  IF l_popup IS BOUND.
    l_popup->close( ).
  ENDIF.

Regards

Chinnaiya P

daniel_rothmund
Participant
0 Kudos

Thanks for your soultion. Now I have the problem that my abap code not wait until the popup is closed.

Have you a solution for this ?

lr_popup = lr_window_manager->create_window(

modal = abap_true

window_name = 'W_POPCOUNTER' "Name of the window created in step 2

title = 'Please enter all information'

close_button = abap_true

button_kind = if_wd_window=>co_button_ok

message_type = if_wd_window=>co_msg_type_warning

close_in_any_case = abap_false

*MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE

).

lr_popup->open( ).

'/// Not Waitung

concatenate lv_numbersessions_str ' Active User Session from ' iv_sid ' on system are killed' into g_text.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>Now I have the problem that my abap code not wait until the popup is closed.

>Have you a solution for this ?

This is how it should work. Popups aren't like in classic dynpro where processing stops at the popup and continues after the popup closes. In Web Dynpro, you simply are making a request to open the popup at the end of the phase cycle. The code that follows the OPEN method will be executed before the popup is displayed. If there is some logic that needs to be fired when the popup closes, then tie it to the block where you are closing it (in your case in the event handler of the timedTrigger).

Answers (0)