cancel
Showing results for 
Search instead for 
Did you mean: 

createModalWindow doesn't seem to create a MODAL window

Former Member
0 Kudos

SAP J2EE version 7.0 SP13

NWDS is 7.0.13

I have no problem creating a popup window in Java WebDynpro. However, it seems that the window is not modal. Whtever code follows the call to open the modal window continues to run while the window is open.

The following code is in openSaveMsg() method.

IWDWindow modalWindow ;

IWDWindowInfo winInfo = wdComponentAPI.getComponentInfo().findInWindows("SaveMsg");

modalWindow = wdComponentAPI.getWindowManager().createModalWindow(winInfo) ;

modalWindow.setWindowPosition(WDWindowPos.CENTER) ;

modalWindow.setWindowSize(400, 175) ;

modalWindow.setTitle("Do you want to save?") ;

modalWindow.show() ;

Any code that follows openSaveMsg() will execute while the modalWindow is open.

Obviously, there are ways to handle this issue, but I'd like to know how to create a window that's truly modal.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

It seems that you are expecting some values from the model window before further processing should happen. Is this your scenario?

Regards

Ayyapparaj

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

While your code runs on the server your modal window is rendered on the client and in the WD phase model, response rendering is the last phase. The modality of the window is only exposed at the client side and even before the window is rendered as modal, all your code has been executed including whatever code is there after a call to show the modal window.

So if you want to do some processing once some action has been done on the window push the call to show the window as the last line of executable code in the corresponding method and write your processing logic on the modal window button event handlers.

For your case where you are just asking for a confirmation you can use a confirmation dialog. It's simpler & you can find some details [here|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/wd%20java/wdjava%20archive/dialog%20boxes%20in%20web%20dynpro%20applications.pdf].

Regards,

Satyajit.

Former Member
0 Kudos

Thank you both for your attention and replies.

I still tend to wish Web Dynpro behaved more like classic HTML and javaScript on the client side than some kind of hybrid between that and a client/server app.

The phase model is well documented and works as designed, we just have to remember it.

A confirmation dialog wasn't quite enough to handle the information that needed to be displayed to the user, so I coded it to run the actual save processing when the user clicks the OK button.

Regards,

Tom