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.

» jive-data-header=»<"color":"#FFFFFF","backgroundColor":"#6690BC","textAlign":"left","padding":"2","verticalAlign":"top">» style=»border: 1px solid rgb(192, 192, 192); width: 596px;»>

CREATE_EXTERNAL_WINDOWCreates an independent, external browser window with URL address.
CREATE_POPUP_TO_CONFIRMCreates a modal dialog window for displaying a simple text message with optional icon.
CREATE_WINDOWCreates a modal dialog window for displaying an interface view of the current component.
CREATE_WINDOW_FOR_CMP_USAGECreates 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.

sap popup window что это. Смотреть фото sap popup window что это. Смотреть картинку sap popup window что это. Картинка про sap popup window что это. Фото sap popup window что это

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.

sap popup window что это. Смотреть фото sap popup window что это. Смотреть картинку sap popup window что это. Картинка про sap popup window что это. Фото sap popup window что это

1.3 Create a LinkToAction with Event Handler

In the layout of view V_MAIN, create a LinkToAction element with the following properties.

» jive-data-header=»<"color":"#FFFFFF","backgroundColor":"#C0C0C0","textAlign":"left","padding":"2","fontFamily":"arial,helvetica,sans-serif">» style=»border: 1px solid #c0c0c0; width: 373px;»>

Properties (LinkToAction)
IDCREATE_EXTERNAL_WINDOW
textCREATE_EXTERNAL_WINDOW
Events
onActionPOPUP_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.

sap popup window что это. Смотреть фото sap popup window что это. Смотреть картинку sap popup window что это. Картинка про sap popup window что это. Фото sap popup window что это

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)
IDCREATE_POPUP_TO_CONFIRM
textCREATE_POPUP_TO_CONFIRM
Events
onActionPOPUP_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.

» jive-data-header=»<"color":"#000000","backgroundColor":"#FFFF99","textAlign":"center","padding":"2","fontFamily":"arial,helvetica,sans-serif">» style=»border: 1px solid #000000; width: 601px;»>

Parameter MESSAGE_TYPE of method CREATE_POPUP_TO_CONFIRM enables you to specify an icon for the confirmation popup window. The possible values for this parameter are as follows.

Button SetButtons in the Set
IF_WD_WINDOW => CO_BUTTONS_ABORTRETRYIGNOREIF_WD_WINDOW=>CO_BUTTON_NONE
IF_WD_WINDOW=>CO_BUTTONS_OKIF_WD_WINDOW=>CO_BUTTON_OK
IF_WD_WINDOW=>CO_BUTTONS_OKCANCEL
» jive-data-header=»<"color":"#000000","backgroundColor":"#FFFF99","textAlign":"center","padding":"2">» style=»border: 1px solid #000000; width: 444px;»>

Message TypeIcon
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.

sap popup window что это. Смотреть фото sap popup window что это. Смотреть картинку sap popup window что это. Картинка про sap popup window что это. Фото sap popup window что это

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.

sap popup window что это. Смотреть фото sap popup window что это. Смотреть картинку sap popup window что это. Картинка про sap popup window что это. Фото sap popup window что это

sap popup window что это. Смотреть фото sap popup window что это. Смотреть картинку sap popup window что это. Картинка про sap popup window что это. Фото sap popup window что это

sap popup window что это. Смотреть фото sap popup window что это. Смотреть картинку sap popup window что это. Картинка про sap popup window что это. Фото sap popup window что это

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)
IDCREATE_WINDOW
textCREATE_WINDOW
Events
onActionPOPUP_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.

Parameter MESSAGE_TYPE of method CREATE_WINDOW enables you to specify an icon for the confirmation popup window. The possible values for this parameter are as follows.

Button SetButtons in the Set
IF_WD_WINDOW => CO_BUTTONS_ABORTRETRYIGNOREIF_WD_WINDOW=>CO_BUTTON_NONE
IF_WD_WINDOW=>CO_BUTTONS_OKIF_WD_WINDOW=>CO_BUTTON_OK
IF_WD_WINDOW=>CO_BUTTONS_OKCANCEL
» jive-data-header=»<"color":"#FFFFFF","backgroundColor":"#6690BC","textAlign":"center","padding":"2">» style=»border: 1px solid #000000;»>

Message TypeIcon
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)
IDLOCKED_MESSAGE
textThe 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.

sap popup window что это. Смотреть фото sap popup window что это. Смотреть картинку sap popup window что это. Картинка про sap popup window что это. Фото sap popup window что это

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.

sap popup window что это. Смотреть фото sap popup window что это. Смотреть картинку sap popup window что это. Картинка про sap popup window что это. Фото sap popup window что это

Also add the component usage to view V_MAIN.

sap popup window что это. Смотреть фото sap popup window что это. Смотреть картинку sap popup window что это. Картинка про sap popup window что это. Фото sap popup window что это

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)
IDCREATE_WINDOW_FOR_CMP_USAGE
textCREATE_WINDOW_FOR_CMP_USAGE
Events
onActionPOPUP_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.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *