cancel
Showing results for 
Search instead for 
Did you mean: 

Need to stop creation of second popup until first popup is completed

GreggHinkle
Participant
0 Kudos

Hi All,

I have a popup window in a WD component that display a PDF report. It works perfectly. However, I just received a new requirement to create another popup window immediately prior to the PDF report popup window which will allow the users to answer a Yes/No question which will change the content of the PDF. I thought that this would be a simple request and created another window for this new popup and preceded the call to create the PDF popup window with a call to create and open the new popup window. The problem now is that when I run the WD Application, both popups are created and opened at the same time with the first popup behind the second popup. I do not want the second popup to be created and opened until the user selects Yes/No on the first popup window.

Does anyone have an idea how to accomplish this?

Thanks,

Gregg

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Since you are opening both the windows at the same time, two popups are opening. There are mutliple ways to resolve this.

1. You can have flag set in the main componenet and put an if condition just before the code for second popup, the value of the flag can be set in the first popup on selection.

2. Second alternative would be display the PDF in the same popup. You could insert the view of second windows in the first window and create a navigation link from one view to another view.

3. Third alternative would be create the field for user input in the second popup and display the PDF on the selection of the value in the field.

Answers (2)

Answers (2)

GreggHinkle
Participant
0 Kudos

Hi Rohit,

Thanks for your suggestion. I guess that I was assuming that the popup windows would be created and displayed in a synchronous manner. So I took your suggestion #1, and applied your suggestion to my component and it works great. Thanks again.

GreggHinkle
Participant
0 Kudos

Following is the code that I am currently using that is causing the issue:


*-- Data definition
  DATA: lv_title           TYPE string.

*-- Window Definition
  DATA:
        lr_window_manager TYPE REF TO if_wd_window_manager,
        lr_api_component  TYPE REF TO if_wd_component,
        lr_popup_window   TYPE REF TO if_wd_window,
        lr_pdf_window     TYPE REF TO if_wd_window.

*--  Update the context before any action processing
  wd_this->update_context(  ).

  lv_title = wd_assist->if_wd_component_assistance~get_text( 'TPP' ).

  lr_api_component  = wd_this->wd_get_api( ).
  lr_window_manager = lr_api_component->get_window_manager( ).

  lr_popup_window  = lr_window_manager->create_window(
                     window_name            = 'ZZ_W_POPUP'
                     title                  = lv_title
                     message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                     button_kind            = if_wd_window=>co_buttons_yesno
                     message_type           = if_wd_window=>co_msg_type_question
                     default_button         = if_wd_window=>co_button_yes ).
  lr_popup_window->open( ).

  lv_title = wd_assist->if_wd_component_assistance~get_text( 'TPP' ).
  lr_pdf_window    = lr_window_manager->create_window(
                     window_name            = 'ZZ_W_PRINT_PDF'
                     title                  = lv_title
                     message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                     button_kind            = if_wd_window=>co_buttons_ok
                     message_type           = if_wd_window=>co_msg_type_none
                     default_button         = if_wd_window=>co_button_ok ).

  lr_pdf_window->set_window_size( width  = '98%'
                                  height = '100%' ).
  lr_pdf_window->open( ).