on 09-05-2008 8:46 AM
Hi, experts,
I create a table with 600 entries data and a delete button named delete_button in webdynpro for java.
when I click the delete_button, the page would pop up a window to tell me: "Do you want to delete the data? "
If I click "ok", The entry would be deleted, otherwise, I click "concel",the entry wouldn't be deleted,
My problem is:
I don't how to complete the pop up window in the page.
Do you give me some hint?
Thanks a lot.
Best regards,
tao
Add this code to the Delete button which opens the Pop up
public void onActionDelete(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionDelete(ServerEvent)
// Call a confirmation dialog to make sure they want to convert
IWDControllerInfo controllerInfo =
wdControllerAPI.getViewInfo().getViewController();
String dialogText = "Are you sure you want to delete?";
IWDConfirmationDialog dialog =
wdComponentAPI.getWindowManager().createConfirmationWindow(
dialogText,
controllerInfo.findInEventHandlers("onActionDeleteYes"),
"Yes");
dialog.addChoice(
controllerInfo.findInEventHandlers("onActionDeleteNo"),
"No");
dialog.show()
}
Then in the handlers onActionDeleteYes() write the code for deletion.
In handler onActionDeleteNo() you can show a message like
"Nothing deleted".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi wang
Plz refer the following link
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/creatingConfirmationDialogBoxinWebDynproJava
regards
Naresh Garg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have did the same requirement in this way..
I created a new window for delete confirmation. And then embedded a new view in it. On click of the delete button in the table, i open this window. The new view embedded in the window contains the message "do you want to delete?" and two buttons (1 for yes and 1 for no). On click of yes, i fire the event which is handled in the parent view with table and i remove current context element of the table (lead selected element of the table node). On click of "No" i just fire the event coming back to main screen and NOT remove the current context element of the table.
Let me know if you want the code for the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
create eventHandler on the delete button onAction property.
and place the below code it will give confirmation window.
IWDControllerInfo controllerInfo =
wdControllerAPI.getViewInfo().getViewController();
String dialogText = "Confirm Deletion";
IWDConfirmationDialog dialog =
wdComponentAPI.getWindowManager().createConfirmationWindow(
dialogText,
controllerInfo.findInEventHandlers("Yes"),
"Yes");
dialog.addChoice(
controllerInfo.findInEventHandlers("No"), "No");
dialog.open();
and create two eventhandlers Yes and No.
write the code to delete the data in these eventHandlers.
refer the below link
Regards,
ramesh
Edited by: Ramesh Babu V on Sep 5, 2008 1:38 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.