on 12-13-2007 12:08 PM
Hello,
First of all i use SAP NW CE 7.1.
I want to implement a popup with this code:
IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();
String dialogText = "Are you sure you want to cancel?";
WDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,
controllerInfo.findInEventHandlers("onYesButtonPressed"), "Yes");
dialog.addChoice(controllerInfo.findInEventHandlers("onNoButtonPressed"), "No");
dialog.show();
But Eclipse says:
<i>-The type IWDConfirmationDialog is deprecated
-The method createConfirmationWindow(String, IWDEventHandlerInfo, String) from the type IWDWindowManager is deprecated
-The method addChoice(IWDEventHandlerInfo, String) from the type IWDConfirmationDialog is deprecate</i>
The @deprecated annotation in com.sap.tc.webdynpro.services.session.api.IWDConfirmationDialog says:
<i> This interface is not part of the Web Dynpro API and might be withdrawn with the first new NetWeaver release in 2007. Please use {@link com.sap.tc.webdynpro.progmodel.api.IWDConfirmationDialog} instead</i>
So I want use <i>com.sap.tc.webdynpro.progmodel.api.IWDConfirmationDialog</i>. Of course if I use this code:
com.sap.tc.webdynpro.progmodel.api.IWDConfirmationDialog dialog =
wdComponentAPI.getWindowManager().createConfirmationWindow(
dialogText, controllerInfo.findInEventHandlers("yes"), "yes");
there is a type conflict because the method <i>createConfirmationWindow</i> return <i>com.sap.tc.webdynpro.services.session.api.IWDConfirmationDialog</i>
<b>How can I instantiate <i>com.sap.tc.webdynpro.progmodel.api.IWDConfirmationDialog</i> with the attribute <i>wdComponentAPI</i>?</b>
Regards,
Armin
Hi Armin,
Try this methods in NW CE 7.1 for confirmation dialog.
IWDConfirmationDialog dialog = wdThis.wdGet<Component controller>.wdGetAPI().getWindowManager() .createConfirmationWindow("Confirmation Text", wdThis.wdget<Action name>, label);
dialog.addChoice(IWDAction action, label);
dialog.show();
Instead of trying it with event handlers they have given a new method for using actions.
Try it out with Actions it should work.
Regards,
Nagarajan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1. The method <i>getWindowManager()</i> is not defined for <i>wdThis.wdGet<Component controller></i>.
2. The Method <i>createConfirmationWindow</i> is also depreacated:
<i>@deprecated This method is not part of the of the Web Dynpro API and might be withdrawn with the first new NetWeaver release in 2007. Please use {@link com.sap.tc.webdynpro.progmodel.api.IWDWindowManager#createConfirmationDialog(String, IWDAction, String)} instead.</i>
Regards,
Armin
Hi Armin,
I too found that the method has been deprecated.
Are you sure you don't get the getWindowManager() method. Because i tried the same code and i m able to get it in my studio.
Did you add the component controller in the view properties and then tried the code? For example i have given the code and you need to replace the <component controller> with the original name of your controller. Then you will get it.
say for eg. yuor component controller name is <u>test</u> then the code would be like this...
IWDConfirmationDialog dialog = wdThis.wdGettestController().wdGetAPI().getWindowManager().
.createConfirmationWindow("Confirmation Text", wdThis.wdGet<your action name>, "label");
dialog.addChoice(wdThis.wdGet<your action name>, label);
Regards,
Nagarajan
Hi,
Try this:
/**
*Here I'm using the following variant of createConfirmationWindow
*createConfirmationWindow(String confirmationText, IWDEventhandlerId eventHandlerId, String label)
*If you have an event handler method called onActionGetPODetails, you can access
*its id via wdThis.WD_EVENTHANDLER_ON_ACTION_GET_PO_DETAILS
*Please note that if you have used event handler ID once, then you will have to use it
*throughout, i.e. for adding choices too.
*/
IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(confirmationText, wdThis.WD_EVENTHANDLER_ON_ACTION_GET_PO_DETAILS, label);
dialog.addChoice(wdThis.WD_EVENTHANDLER_ON_ACTION_LOAD_PANE, label, true);
dialog.show()
Regards,
Satyajit.
Hello Nagarajan,
now I get the getWindowManager() method I forgot .wdGetAPI(). but this
wdThis.wdGettestController().wdGetAPI().getWindowManager().
.createConfirmationWindow("Confirmation Text", wdThis.wdGet<your action name>, "label");
returns <i>com.sap.tc.webdynpro.services.session.api.IWDConfirmationDialog</i>!
This is deprecated and I dont want to use this!
I want to get <i>com.sap.tc.webdynpro.progmodel.api.IWDConfirmationDialog</i>.
Thats the reason for this thread.
So the this
com.sap.tc.webdynpro.progmodel.api.IWDConfirmationDialog dialog = ...
has to be continued.
@Satyajit
Same answer to you...
Regards,
Armin
Hi Armin,
I can find no errors or deprecation seen in my studio. I have given the com.sap.tc.webdynpro.progmodel.api.IWDConfirmationDialog same interface what you were asking for.
K let us try out this way.
When you type in IWDConfirmationDialog you will find two interfaces for this. One the one we wish to achieve and the other deprecated. Select the one which we want and then do the coding you will not find any errors.
Regards,
Nagarajan.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.