cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with confirmation popup window

Former Member
0 Kudos

Hi experts.

I'm presently trying to create some popup window, but I can't manage to find how to.

I've tried some SDN tutorials, and have had lots of deprecated functions problems.

But I've found this tutorial, which fits with the version I use (CE 7.11) : [New Features of Web Dynpro Popup Window - SAP NetWeaver CE 7.11|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a04870c5-749b-2b10-06ba-d25515ef39e3]

Inside it, a code is given (page 7) :

//@@begin javadoc:onActionOpenConfirmation(ServerEvent)
/**
* Declared validating event handler.
*
*@param wdEvent generic event object provided by framework
*/
//@@end
public void onActionOpenConfirmation( com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent ) {
//@@begin onActionOpenConfirmation(ServerEvent)
IWDConfirmationDialog window = wdComponentAPI.getWindowManager()
.createConfirmationWindow(infoText.toString(),
wdThis.wdGetCloseAction(), "Close");
window.addChoice(wdThis.wdGetCancelAction());
if (wdContext.currentContextElement().getHasCloseIcon()) {
window.setOnClose(wdThis.wdGetCloseAction());
IWDAction action = wdControllerAPI.getAction("Close");
window.setOnClose(action);
}
window.setWindowSize(500, 200);
window.show();
//@@end
}

In fact, when I click "organise imports", I have two choices :

com.sap.tc.webdynpro.progmodel.api.IWDConfirmationDialog;

or

com.sap.tc.webdynpro.services.session.api.IWDConfirmationDialog;

But:

the "com.sap.tc.webdynpro.progmodel.api.IWDConfirmationDialog;" import gives me some errors I haven't managed to resolve :

see screenshot : [http://imgur.com/4tBoA.png|http://imgur.com/4tBoA.png]

the "com.sap.tc.webdynpro.services.session.api.IWDConfirmationDialog;" import gives me lots of deprecated erros :

see screenshot :[http://imgur.com/xeb18.png|http://imgur.com/xeb18.png]

My question is : do you have an idea what to do to make to given code work ?

Thank you for advance.

Regards.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi expert,

You can Try thid way................

firstly before you create popup window ,you have to create one eventHandler method then you will create one confirmation window.

let assume eventhander method create as action method creation.

all method declared In View Controller..........

EventHandler method---OK

action method--OkDilog

public void onActionOkDilog(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

String dialogText = "Your confirmation.";

// Get Event Handler Info

IWDEventHandlerInfo eventHandler = wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("OK");

//Create the confirmation dialog, with an "ok" button

WDConfirmationDialog window=wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,eventHandler,"OKk");

wdThis.wdGetCloseAction(), "Close");

window.addChoice(wdThis.wdGetCancelAction());

if (wdContext.currentContextElement().getHasCloseIcon()) {

window.setOnClose(wdThis.wdGetCloseAction());

IWDAction action = wdControllerAPI.getAction("Close");

window.setOnClose(action);

}

window.setWindowSize(500, 200);

window.open();

window.show();

One thing...

Ok handler method you make it blank and put any code in that...after clicking confirmation window button it will executed ...........

thanks

jati

}

Former Member
0 Kudos

Hi,

Please go through this article link

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-tec...

Here i have explained it with an example.

Regards,

Gayathri.

Former Member
0 Kudos

Hi !

I have the same problem, and I thank you for the tutorial (which I hadn't find in the search tool of SDN...).

I've followed it, but It appear I have a lot of errors. The error that comes most often is : wdGetWindowTypeCompController is underlined, and the error message is : "The method wdGetWindowTypeCompController() is undefined for the type IPrivateWindowTypeCompView".

This error appears in the WindowTypeCompView file, PopupWindow file and in the WindowTypeWarning file. It is always the same error message.

I've checked, I have the exact same file names as in the tutorial...

Do you have any idea of how I could solve this issue ?

Thank you for advance.

Former Member
0 Kudos

Hey,

Try this!

import com.sap.tc.webdynpro.services.session.api.IWDConfirmationDialog;

//Find the Event handler for E_Yes

IWDEventHandlerInfo l_event =

wdControllerAPI.getControllerInfo().findInEventHandlers("eh_Ok");

IWDConfirmationDialog l_dia =

wdComponentAPI.getWindowManager().createConfirmationWindow( "Message on pop up", wdControllerAPI.getControllerInfo().getControllerInfo().findInEventHandlers(

"eh_Ok"), "Ok"); //eh_Ok is an event handler

// Setting title

l_dia.setTitle("Confirmation Window");

// Adding another choice

l_dia.addChoice(wdControllerAPI.getControllerInfo().findInEventHandlers("eh_cancel"), "Cancel");

// Open the window

l_dia.open();

Regards,

Preksha

Former Member
0 Kudos

In fact, the way to finish the tutorial is to first create all the context node and attribute in the Controller Context, then to bind the needed context node and attributes in the context of the file that need them.

This have solved every problems I had.

Now it works perfectly !