on 09-04-2009 10:23 AM
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.
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
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please go through this article link
Here i have explained it with an example.
Regards,
Gayathri.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.