on 06-12-2012 4:46 AM
Hi,
In my Webdynpro java Application,
I have to call one conformation dialog to continue the process.
Form one view I am calling one method in controller.That method is calling other methods in controller.
In one senario, one of that method need user event (ok/cancel).
So my question is how can i call this in my Controller method ?
I know this method of creating dialog in view.
IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();
String dialogText = "The email was successfully sent!";
IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,controllerInfo.findInEventHandlers("ok"),"ok");
dialog.addChoice( controllerInfo.findInEventHandlers("newEmail"), "new email");
dialog.open();
But how can I implement this in controller or how can I call this if I implement in view?
Thanks and Regards
Priya
Hi Priya,
You can open a confirmation window even from a method in compenent controller. To extract the event handlers you can use wdThis instead of using wdControllerAPI.
EX: IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow("The email was successfully sent!", wdThis.WD_EVENTHANDLER_CONFIRM_ACTION, "Yes");
dialog.addChoice(wdThis.WD_EVENTHANDLER_CANCEL_ACTION, "No");
dialog.show();
Assuming confirmAction and cancelAction are two eventHandler methods created in controller.
Regards,
Vishweshwara P.K.M.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishweshwara,
Thanks for reply.
I tried with this.
I have created two event hadler
public void confirmAction(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
public void cancelAction(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
But it is showing error
addChoice( IWDEventHandlerInfo, String) is not applicable for
addChoice( IWDEventHandlerId, String).
how can define it as IWDEventHandlerInfo ?
Thanks and Regards,
Priya
Hi Priya,
I guess you are using NWDS 7.0x, so you are not able to provide IWDEventHandlerId. You can use the below line of code to extract the controllerInfo and then use this to extract the eventHandlerInfo as you did in view controller.
IWDControllerInfo controllerInfo = wdControllerAPI.getComponentInfo().findInControllers("<Component Name>");
Regards,
Vishweshwara P.K.M.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.