sap popup window что это
The Four Types of Popup Window
Interface IF_WD_WINDOW_MANAGER provides four methods for creating a secondary window in a Web Dynpro ABAP component. These methods may be used to open a modal dialog window with simple text or content from a Web Dynpro view or open an independent browser window with a URL address. Each method is discussed below and an example is given of its implementation.
CREATE_EXTERNAL_WINDOW | Creates an independent, external browser window with URL address. |
CREATE_POPUP_TO_CONFIRM | Creates a modal dialog window for displaying a simple text message with optional icon. |
CREATE_WINDOW | Creates a modal dialog window for displaying an interface view of the current component. |
CREATE_WINDOW_FOR_CMP_USAGE | Creates a modal dialog window for displaying an interface view of a component usage. |
1.0 CREATE_EXTERNAL_WINDOW
This method creates an independent, external browser window with URL address. It may be used to open a secondary browser window containing a different web application or an internet website.
Procedure
1.1 Create a Web Dynpro Component
Create a Web Dynpro component, ZDEMO_POPUPS with a view, V_MAIN and window, W_MAIN. Also create an application for the component.
1.2 Create a Window Attribute
In the component controller, create a public attribute WINDOW to store a reference to the popup window object. Having a reference available as a public attribute enables us to access and control the popup window from any view.
1.3 Create a LinkToAction with Event Handler
In the layout of view V_MAIN, create a LinkToAction element with the following properties.
Properties (LinkToAction) | |
---|---|
ID | CREATE_EXTERNAL_WINDOW |
text | CREATE_EXTERNAL_WINDOW |
Events | |
onAction | POPUP_EXTERN_WINDOW |
1.4 Implement Event Handler POPUP_EXTERN_WINDOW
Implement the event handler method for the LinkToAction element as follows.
1.5 Run the Application
Save, activate and run the Web Dynpro application. Clicking the link CREATE_EXTERNAL_WINDOW opens a new browser window showing the specified web address.
2.0 CREATE_POPUP_TO_CONFIRM
This method creates a modal dialog window for displaying a simple text message with optional icon. With this method, there is no need to specify an interface view to contain the text message; the interface view is provided by the runtime.
Procedure
2.1 Create a LinkToAction with Event Handler
Repeat steps 1.1 Create a Web Dynpro Component and 1.2 Create a Window Attribute of section CREATE_EXTERNAL_WINDOW to create a new Web Dynpro component and window attribute, or skip these steps and extend the component created in section CREATE_EXTERNAL_WINDOW.
In the layout of view V_MAIN, create a LinkToAction element with the following properties.
Properties (LinkToAction) | |
---|---|
ID | CREATE_POPUP_TO_CONFIRM |
text | CREATE_POPUP_TO_CONFIRM |
Events | |
onAction | POPUP_TO_CONFIRM |
2.2 [OPTIONAL] Implement an Event Handler Method for Button Click Events
This step is only needed if you want to subscribe to button click events in the confirmation popup window.
In view V_MAIN, create an event handler method POPUP_TO_CONFIRM_EVENT_HANDLER and implement it as follows. An event handler might be used, for example, to update the context according to the user’s response in the confirmation popup window.
2.3 Implement Event Handler POPUP_TO_CONFIRM
Parameter BUTTON_KIND of method CREATE_POPUP_TO_CONFIRM enables you to specify a set of buttons for the confirmation popup window. The possible values for this parameter are as follows.
Button Set | Buttons in the Set | |||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
IF_WD_WINDOW => CO_BUTTONS_ABORTRETRYIGNORE | IF_WD_WINDOW=>CO_BUTTON_NONE | |||||||||||||||||||||||||||||||||||||||||||||||||||||
IF_WD_WINDOW=>CO_BUTTONS_OK | IF_WD_WINDOW=>CO_BUTTON_OK | |||||||||||||||||||||||||||||||||||||||||||||||||||||
IF_WD_WINDOW=>CO_BUTTONS_OKCANCEL |
Message Type | Icon |
---|---|
IF_WD_WINDOW=>CO_MSG_TYPE_ERROR | |
IF_WD_WINDOW=>CO_MSG_TYPE_INFORMATION | |
IF_WD_WINDOW=>CO_MSG_TYPE_NONE | |
IF_WD_WINDOW=>CO_MSG_TYPE_QUESTION | |
IF_WD_WINDOW=>CO_MSG_TYPE_STOPP | |
IF_WD_WINDOW=>CO_MSG_TYPE_WARNING |
Implement the event handler method for the LinkToAction element as follows. Lines 24 through 46 subscribe to button click events within the confirmation popup window. These lines should only be included if you implemented the event handler for button click events in Step 2.2.
2.4 Run the Application
Save, activate and run the Web Dynpro application. Clicking the link CREATE_POPUP_TO_CONFIRM opens a confirmation popup window. If the user closes the popup window by means of either the OK or Cancel buttons, the button click event is captured by method POPUP_TO_CONFIRM_EVENT_HANDLER.
3.0 CREATE_WINDOW
This method creates a modal dialog window for displaying an interface view of the current component. Since the view displayed belongs to the current component, the developer has full control over the popup window’s content and behavior.
Procedure
3.1 Create a View and Window for the Popup
Repeat steps 1.1 Create a Web Dynpro Component and 1.2 Create a Window Attribute of section CREATE_EXTERNAL_WINDOW to create a new Web Dynpro component and window attribute, or skip these steps and extend the component created in section CREATE_EXTERNAL_WINDOW.
Add a new view V_POPUP and a new window W_POPUP to the component, and embed view V_POPUP into window W_POPUP.
3.2 Create a LinkToAction with Event Handler
In the layout of view V_MAIN, create a LinkToAction element with the following properties.
Properties (LinkToAction) | |
---|---|
ID | CREATE_WINDOW |
text | CREATE_WINDOW |
Events | |
onAction | POPUP_WINDOW |
3.3 Implement Event Handler POPUP_WINDOW
Parameter BUTTON_KIND of method CREATE_WINDOW enables you to specify a set of buttons for the confirmation popup window. The possible values for this parameter are as follows.
Button Set | Buttons in the Set | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
IF_WD_WINDOW => CO_BUTTONS_ABORTRETRYIGNORE | IF_WD_WINDOW=>CO_BUTTON_NONE | |||||||||||||||||||||||||
IF_WD_WINDOW=>CO_BUTTONS_OK | IF_WD_WINDOW=>CO_BUTTON_OK | |||||||||||||||||||||||||
IF_WD_WINDOW=>CO_BUTTONS_OKCANCEL |
Message Type | Icon |
---|---|
IF_WD_WINDOW=>CO_MSG_TYPE_ERROR | |
IF_WD_WINDOW=>CO_MSG_TYPE_INFORMATION | |
IF_WD_WINDOW=>CO_MSG_TYPE_NONE | |
IF_WD_WINDOW=>CO_MSG_TYPE_QUESTION | |
IF_WD_WINDOW=>CO_MSG_TYPE_STOPP | |
IF_WD_WINDOW=>CO_MSG_TYPE_WARNING |
Implement the event handler method for the LinkToAction element as follows.
3.4 Give View V_POPUP Some Content
Since it is local to the current component, you have full control over the popup window’s content and behavior. In this example, we will keep it simple. In the layout of view V_POPUP, create a TextView element with the following properties.
Properties (TextView) | |
---|---|
ID | LOCKED_MESSAGE |
text | The record you attempted to update is locked by another user. |
3.5 [OPTIONAL] Implement an Action and Handler Method for Button Click Events
This step is only needed if you want to subscribe to button click events in the popup window.
In the layout of view V_POPUP, create an action POPUP_ACTION and implement its handler method as follows. An action might be used, for example, to update the context according to the user’s response in the popup window.
3.6 [OPTIONAL] Subscribe to Button Click Events
This step is only needed if you want to subscribe to button click events in the popup window.
In hook method WDDOINIT of view V_POPUP, subscribe to desired button click events.
3.7 Run the Application
Save, activate and run the Web Dynpro application. Clicking the link CREATE_WINDOW opens a popup window displaying view V_POPUP. If the user closes the popup window by means of either the Cancel, Repeat or Ignore buttons, the button click event is captured by action POPUP_ACTION.
4.0 CREATE_WINDOW_FOR_CMP_USAGE
This method creates a modal dialog window for displaying an interface view of a component usage.
Procedure
4.1 Create a Component Usage
Repeat steps 1.1 Create a Web Dynpro Component and 1.2 Create a Window Attribute of section CREATE_EXTERNAL_WINDOW to create a new Web Dynpro component and window attribute, or skip these steps and extend the component created in section CREATE_EXTERNAL_WINDOW.
Add a component usage to the component ZDEMO_POPUPS. In this example, we use a component developed for another walk-through tutorial, ZDEMO_ALV.
Also add the component usage to view V_MAIN.
4.2 Create a LinkToAction with Event Handler
In the layout of view V_MAIN, create a LinkToAction element with the following properties.
Properties (LinkToAction) | |
---|---|
ID | CREATE_WINDOW_FOR_CMP_USAGE |
text | CREATE_WINDOW_FOR_CMP_USAGE |
Events | |
onAction | POPUP_CMP_USAGE |
4.3 Implement Event Handler POPUP_CMP_USAGE
Implement the event handler method for the LinkToAction element as follows. Parameter INTERFACE_VIEW_NAME of method CREATE_WINDOW_FOR_CMP_USAGE is the name of the used component’s interface view, i.e., its window.
4.4 Run the Application
Save, activate and run the Web Dynpro application. Clicking the link CREATE_WINDOW_FOR_CMP_USAGE opens a popup window displaying the contents of the component usage interface view.
- Что значит косвенный падеж
- с праздником люблю тебя