UNID?EditDocument -> user change -> document is saved and redirect user to UNID?OpenDocument
More than that, suppose it's an application already working, which performs a JS sumbit(), then the WQS agent kicks in, create the document, then the same agent does :
Print "[/" & web_db_name & "/(someView)/" & docSaved.UniversalID & "?OpenDocument]"
which is basically the redirection.
Where does the Back button fit this picture ? from OpenDocument resulting page, if the user performs Right Click/Back, it ends up in the same EditDocument page and you don't want that. What to do ?
The simplest solution to avoid this:
Instead of printing the redirection URL directly, print the HTML code of a page which performs the redirection on the onload event. The code would look like this:
The UtilEscapePath and WebReturnUrl are two subroutines which you can find in the names.nsf of your server (WebLSUtil library, for Domino 6). Thanks IBM for that, good idea ! It is sometimes useful to have a look into the design of Domino default templates, specific the system names.nsf :)
UtilEscapePath basically changes \ with / so it will comply with URL format. Most interesting is WebReturnUrl:
There you have it, the first 'level' of Back will no longer open the document in Edit mode. This is not a full-proof solution as selecting browser's drop-down and going back two 'levels' will of course break this. However for the 'right-click/back' it works and may be sufficient for your application.