on 02-19-2008 10:25 AM
I want to show confirmation dialog box when user clicks on the delete button. Need some code samples on how to implement it.
Create two events named "ok" and "cancel" respectively using method tab on your view screen.
Now add following lines in your delete action on which you want to show the confirm dialog box.
public void onActionDelete(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionSimulateOrder(ServerEvent)
IWDControllerInfo cinfo = wdControllerAPI.getViewInfo().getViewController();
IWDConfirmationDialog confirmDialog = wdComponentAPI.getWindowManager().createConfirmationWindow(
"Are you sure you wish to delete?", cinfo.findInEventHandlers("ok"), "Yes");
confirmDialog.addChoice(cinfo.findInEventHandlers("cancel"), "No");
confirmDialog.show();
//@@end
}
//@@begin javadoc:ok(ServerEvent)
/** Declared validating event handler. */
//@@end
public void ok(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin ok(ServerEvent)
//@@end
}
//@@begin javadoc:cancel(ServerEvent)
/** Declared validating event handler. */
//@@end
public void cancel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin cancel(ServerEvent)
//@@end
}
When you click on your action a confirm dialob box will appear with message text "Are you sure you wish to delete?" and two buttons "Yes" and "No" mapped to ok and cancel events respectively. Write code in your ok and cancel event to implement the functionality of the buttons.
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
http://help.sap.com/saphelp_nw04/helpdata/en/b0/184540631d6f13e10000000a1550b0/frameset.htm
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1. Open your view>Methods(Tab)>new event handler and name it as Ok
add one more event handler with the name Cancel
2. Write this code in the action for your delete button.
IWDEventHandlerInfo eventhandler = wdControllerAPI.getViewInfo().getViewController().findinEventhandlers("Ok");
IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationDialog("Are you sure you want to delete?",eventhandler,"Ok");
eventhandler = wdControllerAPI.getViewInfo().getViewController().findinEventhandlers("Cancel");
dialog.addChoice(eventhandler,"Cancel");
dialog.show();
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.