cancel
Showing results for 
Search instead for 
Did you mean: 

How to complete the pop up window ?

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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".

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi wang

Plz refer the following link

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/creatingConfirmationDialogBoxinWebDynproJava

regards

Naresh Garg

former_member187439
Active Participant
0 Kudos

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.

Former Member
0 Kudos

Hi,

Please go through this thread

Regards

Ayyapparaj

Former Member
0 Kudos

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

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/903fed0d-7be4-2a10-cd96-91367073...

Regards,

ramesh

Edited by: Ramesh Babu V on Sep 5, 2008 1:38 PM