cancel
Showing results for 
Search instead for 
Did you mean: 

Pop Up Window on click of save button

Former Member
0 Kudos

Hi ,

I am very new to WebDynpro Java.

Can somebody plz help me??

My Requirement-

On Click of the Save Button ,a Pop Up window should get displayed with a message saying "SUCCESSFULLY SAVED".

Plz reply soon

Thanks In advance!!

Regards

Smita

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Smitha,

Use the following code after doing the save operation on click of button. For this you need to create one event handler (here in example it is: Ok) also.

IWDConfirmationDialog cWin =wdComponentAPI.getWindowManager().createConfirmationWindow("Skills added successfully.",wdThis.wdGetAPI().getViewInfo().getViewController().findInEventHandlers("Ok"),"Ok");

cWin.open();

Here cWin.open() will open the popup window.

Skills added successfully will be text which you want to display.

Hope this may help you.

Nelly

Former Member
0 Kudos

Hi.........I understood .....but on click of save button (OK button in the example) i have to call an event handler..

Can u plz elaborate a bit on that.

Thanx a lot!!

Regards

Smita Mohanty

Former Member
0 Kudos

Hi,

That event handler is used to handle the click of OK.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

just we have to create Ok event handler,

IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(

"Success",

coninfo.findInEventHandlers("Ok"),

"Ok");

if you observe the popup code, findInEventHandlers("Ok") will call the event handler with name Ok when user press the "Ok" in pop up.

hope you got it.

Regards,

ramesh

Former Member
0 Kudos

Hi....thnx a lot......it solved my requirement

Answers (7)

Answers (7)

Former Member
0 Kudos

hi!

1.create a action on the button click

2.create a value node(popup)--> value attribute

set the cardinallity as 1..1 and type as com.sap.tc.webdynpro.

services.session.api.IWDWindow

3.

public void okPopup() {

// @@begin okPopup()

// get the repository content at runtime of the Web-Dynpro-

IWDWindowInfo windowInfo = (IWDWindowInfo) wdComponentAPI

.getComponentInfo().findInWindows("okWindow");//give your window name

// create the u201CokWindowu201D

IWDWindow window = wdComponentAPI.getWindowManager()

.createModalWindow(windowInfo);

// set the WindowPosition on the screen

window.setWindowPosition(300, 150);

// and show the window

window.show();

// Save WindowInstance in Context

wdContext.currentPopupElement().setWindowInstance(window);

// @@end

}

4.now you can take text views to show the required message in the popup window.for that you can take the message from message pool and also you can directly write the message in the text property of text view.

please get back to me if any further clarification is required.

thanks

vishal

Former Member
0 Kudos

thnx a lot for ur reply.....its very useful!!

Former Member
0 Kudos

Hi,

This code will solve ur problem.

IWDControllerInfor controllerInfo=wdControllerAPI.getViewInfo().getViewController();

String dialogText = "Successfully Saved";

IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,controllerInfo.findInEventHandlers("ok"),"ok");

dialog.open();

Regards,

Sunaina Reddy T

Former Member
0 Kudos

Hi,

If you want a popup to have options save or exit then

you need to have two event handlers

1) Create two event handlers Ok,close under methods tap select eventhandler radio button.

2)In action button you write the following code

IWDControllerInfo cntrl_info = wdControllerAPI.getViewInfo().getViewController();

IWDConfirmationDialog confirm = wdComponentAPI.getWindowManager().createConfirmationWindow("You are going to Exit, Want to Proceed?", cntrl_info.findInEventHandlers("cancel"),"Cancel");

confirm.addChoice(cntrl_info.findInEventHandlers"ok"),"Confirm");

confirm.setWindowSize(250,100); confirm.setWindowPosition(100,100);

confirm.show();

3) In "ok" method in implementation you write your code to save.

Regards

RAghu

Former Member
0 Kudos

Hi,

This code will solve ur problem.

IWDControllerInfor controllerInfo=wdControllerAPI.getViewInfo().getViewController();

String dialogText = "Successfully Saved";

IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,controllerInfo.findInEventHandlers("ok"),"ok");

Regards,

Sunaina Reddy T

Former Member
0 Kudos

Hi,

Go through this link and see Creating Dialog Boxes,It will help you

/docs/DOC-8061#23

Regards

Padma N

Former Member
0 Kudos

Hi Smita,

1. Create an event in your view named OK.

2. Put this code in method for the event on SAVE button.

IWDEventHandlerInfo eventhadler = wdThis.wdGetAPI().getViewInfo().getViewController().findInEventHandlers("Ok");

IWDConfirmationDialog confirmwindow =wdComponentAPI.getWindowManager().createConfirmationWindow("Successfully Saved.",eventhandler,"Ok");

confirmwindow.open();

Regards,

Murtuza Kharodawala

Former Member
0 Kudos