cancel
Showing results for 
Search instead for 
Did you mean: 

how to create popup Windows in WebDynpro

Former Member
0 Kudos

I am learning WebDynpro and have developed a sample application where i ask the user to login. In case of incorrect login I want to display a popup window which shows an error message and has an ok button on it. On click of the OK button i want to close the Window.

I have created a view for this popup... called errorView

On click of login button i perform validations n incase the validatins fail i have put in the following code

IWDWindowInfo myWinInfo = wdComponentAPI.getComponentInfo().findInWindows("Ra_ErrorView");

myPopupWindow = wdComponentAPI.getWindowManager().createWindow(myWinInfo,true);

myPopupWindow.setWindowPosition(300,150);

myPopupWindow.open();

How should i proceed?

Where should i write the myPopupWindow.close()

Kindly give a step-by-step solution.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Reema,

Please check the following doc for completing your app :-).

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/di... boxes in web dynpro applications.pdf

Regards, Anilkumar

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Reema,

I need to develop a login screen with validations using popup.Can you help me out in developing this popup.

Thanks&Regards,

Prasanna

Former Member
0 Kudos

Hi Reema,

You want to close a window say window1 which you opened from a view.

create an attribute. select its type from java native settings to IWDWindow

wdContext.currentcontextElement().setWindowInstance(window);

1.create an event in component controller say event1

2.In order to trigger the event in component controller create a method in it

write this code in implementation of controller to trigger the event

wdThis.wdFireEventAddressSelectedEvent();

3.For catching whatever event that is responsible for closing the window create an event handler in view1 say eventhandler1.Choose the subscibed event to be event1

4.In that eventhandler1 write the code in implementation

IWDWindow window =

wdContext.currentcontextElement().getWindowInstance();

window.close();

Hope this helps you.Do revert back if you have more doubts

Regards

Rohit

Message was edited by: Rohit Radhakrishnan

Former Member
0 Kudos

IWDControllerInfo controllerInfo =

wdControllerAPI.getViewInfo().getViewController();

String dialogText = "The email was successfully sent!";

IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(

dialogText,

controllerInfo.findInEventHandlers("ok"),

"ok");

This is the code for creating the popup window. The code that you have given creates an external window and not a pop up window.

Note that while you create this you would also need a an eventhandler created with the name you have specified(ok in this case).

For further nformation check the following link

http://help.sap.com/saphelp_nw04/helpdata/en/b0/184540631d6f13e10000000a1550b0/frameset.htm

Former Member
0 Kudos

hi Reema,

What do you want to create external window or confirmation dialog box.If you want to create a confirmation dialog Noufal has provided the code. You have specified in your first post that you have created an external window.For closing the external window do as in my previous post.

Hope this helps you

Regards

Rohit

Former Member
0 Kudos

Hi Reema,

Well you are able to open the pop up wimdow.

To Close it, follow this step

1. Create an event in the component controller and a method to fire this event.

2. add controller as the Required Controller in the properties of Login View.

3. in the pop view, raise the event defined in the controller.

4. Add an event in the Login view with Source event defined in the controller.

also make sure u have created navigation link from both views to controllers

Rgds,

Vilish