cancel
Showing results for 
Search instead for 
Did you mean: 

Popup Window

08-13-2016 11:49 PM
781 views 7 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

I have a popup window in an MDI application that displays a list of training classes.  The user chooses one by double clicking the row in the popup.  The popup uses embedded SQL to insert that row from the training table into a table for a particular user.  Works fine.  But after the insert and either before or after I close the popup window I would like to do a new retrieve for the data window which received the insert.  How does one call a popup, choose a selection, have it inserted into a table, close the popup, and then refresh the data window for the user so they can see it is there?  Where would this last retrieve statement go?

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

If you used a Response window, it could go after the Open.

Former Member
0 Likes

Most excellent, thanks much

Former Member
0 Likes

Hi James;

  That won't necessarily work properly because you don't know if the user actioned any rows or if the user just cancelled out of either the Response or Pop-up window.

  What I would do is pass the DataWindow Control's address into the selection dialogue. Then let the list dialogue decide if it needs to send a "refresh" request back to the DC (if necessary).

Good luck.

Regards ... Chris

Former Member
0 Likes

Passing the DW address to the response window is not a good idea because it will then couple both objects making future maintenance harder specially if the popup is intended to be called from different windows.

From the response window just close it with a return argument that will tell the calling window if it needs to be refreshed or not (e.g. CloseWithReturn(This, "1") <refresh>, CloseWithReturn(This, "0") <no need to refresh>).

Former Member
0 Likes

Hi Ricardo;

   No, not if you design your classes using inclusional polymorphism. That would allow you to post back a function or event without tightly coupling the two objects together. 

  My frameworks use inclusional polymorphism all over their design not operational polymorphism. This allows them to operate on unrelated classes with known behaviour. However, the class that holds the processing responsibility is totally encapsulated. 

Regards ... Chris

Former Member
0 Likes

For this post that's a complex solution to a simple problem. Refreshing the DW control after the open statement depending on the response windows' result will properly work.

Former Member
0 Likes

Yes, it might need to be though.

Your recommendation to use the CloseWithReturn is an excellent suggestion following Roland's "Response" window suggestion.

However, this may totally change the workings of the application if the Pop-up (or even a child) window is being used as a floating toolbar or interactive work area. Changing any window to a type Response makes the entire application Modal. This could change the whole design flow by blocking interactive workings with other object classes or interfere with multithreading activities. All these things should be considered before arbitrarily changing a window's typing.

Just saying. 

Answers (0)