In my Domino web applications, I like to use pop-up boxes to edit different groups of fields on a document. For example, I might have a tabbed form with 5 related fields on each tab. To edit each tab's fields, I use pop-up forms. This lets me enforce some security, show/hide different contextual menu choices, present only the editable form to those users who can access it, etc.
In doing this, I don't much care for the $$Return field since different things can happen when the user submits the form. (Besides, complex formulas can get pretty messy and difficult to read once the development cycle is complete.) For instance, if I'm using Domino to capture data and then sending that data off to a relational database, the update can succeed or fail. If it fails, I need a smooth way to inform the user. If it succeeds, I need to refresh the 'read only' form / frames to reflect the results.
It's based on a couple of different elements:
1. Put a hidden field on your pop-up form called 'ReloadString'
3. For the pop-up form's WebQuerySave event, enter an agent to run against the saved data.
4. In the agent, do whatever you need to do to the saved data i.e. save it via ODBC to a relational database, update some other documents based on the saved data, etc.>
Print "<html><body><script>(contents of ReloadString);window.close;</script></body></html>"
If all is not well, send back the error or other information via a Print statement e.g.
Print "<html><Head>Error</Head><Body>Could not update the data on datasource MyDatasource. Record not saved.</Body></Html>"
This will let your pop-up window manipulate other browser windows and then close itself. This is really handy if you have a form with embedded Layers or IFRAMES that invoke pop-up forms. The user can change data from one frame and, if the update succeeds, see those changes reflected in the other frames/layers.