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?
Request clarification before answering.
If you used a Response window, it could go after the Open.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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>).
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
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.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.