
Application DEMO_POPUPS_02 of the DEMO_POPUPS_02 main component in the package DEMO_POPUPS_03 shows a demo application for dialog boxes where the dialog box belongs to a component that is used.
Application DEMO_POPUPS_02 demonstrates the following aspects when dealing with dialog boxes in Web Dynpro ABAP:
Creating, opening, and closing a dialog box where its window belongs to an embedded component
Setting some dialog box properties
Registering action handlers on the dialog box buttons
Closing the dialog box depending on a condition
The function and use of the application named above is largely the same as the application DEMO_POPUPS_01 . The following therefore refers to the explanations for this application and only goes into the differences in detail.
The following first explains the process of the DEMO_POPUPS_02 application in general and then deals with the individual relevant methods of the related components more deeply.
For general information about dialog boxes, see Working with Dialog Boxes .
As in DEMP_POPUPS_01, the application DEMO_POPUPS_02 makes it possible to set different dialog box properties dynamically and to check their effect on the appearance and behavior of the dialog box.
The following properties can be set:
Title of the dialog box
Dialog box buttons
Default button
Icons that you want to display in the dialog box
Cancel symbol
Flag if the dialog box is to be closed automatically with a click on a dialog box button
You can find more information on these properties in the related sections under DEMO_POPUPS_01 .
In this example the dialog box belongs to the DEMO_POPUPS_03 component that was used. Therefore the main component DEMO_POPUPS_02 defines a component usage to the component DEMO_POPUPS_03. The dialog box is created and opened in the Action Handler ONACTIONSHOW_POPUP of the MAIN view in component DEMO_POPUPS_02.
The majority of properties of a dialog box (such as button combinations) are directly connected with their content. If the dialog box belongs to a component that is used, then the properties of this cannot be transferred as part of the creation ('from outside'), instead they have to be set within the component that the dialog box belongs to using the programming interface IF_WD_WINDOW .
You can access this programming interface in the method WDDOONOPEN of the window controller that belongs to the gialog box: In this example the window controller is POPUP_01 of the component DEMO_POPUPS_03. The reference to the programming interface IF_WD_WINDOW is 'collected' in this method from the importing parameter WINDOW_DESCR and stored in the POPUP_01 attribute of the component controller.
Setting the dialog box properties takes place in the WDDOINIT method that is embedded in the POPUP_01 window of the V_POPUP_01 view. Actions are also registered to dialog box buttons in this method.
For more information, see DEMO_POPUPS_01 .