cancel
Showing results for 
Search instead for 
Did you mean: 

Dialog box in interactive forms

Former Member
0 Kudos

Hi

I have an interactive form with input fields and the submit button .

After submit button is clicked i update the data in R/3.

After that I want to give a dialog box to the user with the message " Data has been updated successfully. " on the same interactive form .

I am using adobe 9 version.

I used this code but i could not get a dialog box.

please help.

public void onActionSubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionSubmit(ServerEvent)

String dialogText = "Data saved successfully.";

IWDConfirmationDialog dialog =

wdComponentAPI.getWindowManager().createConfirmationWindow

(dialogText,wdThis.wdGetAPI().getViewInfo().getViewController().findInEventHandlers("ok"),"OK");

dialog.open();

//@@end

}

//@@begin javadoc:ok(ServerEvent)

/** Declared validating event handler. */

//@@end

public void ok(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin ok(ServerEvent)

wdDoInit();

//@@end

}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anzar,

I guess yu have created a even handler in Action Tab of the view controller. If no, create a event handler called Ok in action tab view Controller.

Secondly, after you create the event handler, if you see the action tab, the event Handler will be created with the Name onActionOk

Use this name in the code as,

wdComponentAPI.getWindowManager().createConfirmationWindow

(dialogText,wdThis.wdGetAPI().getViewInfo().getViewController().findInEventHandlers("onActionOk"),"OK");

You can also check whether the event is recognizable using the method,

wdComponentAPI.getMessageManager().reportWarning(" they are : "+wdThis.wdGetAPI().getViewInfo().getViewController().hasEventHandler("onActionOk"));

Dont use "ok" and use "onActionOk" as event handler Name. Check the name given under eventHandler column before using it.

Also,

Dont use dialog.open() as method open is deprecated. Use method Show() instead.

Hope it helps.

Edited by: shabir rahim on Jul 4, 2008 12:57 PM

Answers (2)

Answers (2)

Former Member
0 Kudos

Yes solution given by rahim is good. It works and i was also looking same for requirement in my application.

Create an event handler. Using that event handler you can close confirmation window and navigate to required view in application.

Thanks

Mandeep Virk

Former Member
0 Kudos

You can use another view as a pop up to display message.

Confirmation window requires event handlers which are not required in your case.

Only a pop up containing message is required. On close of which you may navigate back to initial window.

Mandeep Virk