When coding on some Domino web app, I frequently need to do more than just a WebQuerySave. I could use a Formula code “@URLOpen()”, but for actions that are really serious it nice to confirm that they really, really, meant to push that button before you launch the nuclear missiles….., and that’s hard to do on the web without a little JavaScript…so this is the sort of code I add to the button or hotspot.:
1 2 3 4 5 6 7 8 9 10 11 12 13 | <br />// this code could be in your JS header or Js include file. <br />path = window.location.pathname.toLowerCase(); <br />nsfPos = path.indexOf(".nsf"); <br />path = path.substring(0, nsfPos+5); <br />// path now contains the relative url of the window upto ".nsf/" <br /> <br />if ( confirm('Please confirm this very dangerous Action.') ) <br />{ <br />f = document.forms[0]; <br />action = path + "YourAngentsName?OpenAgent"; <br />window.location.replace(action); <br />} <br /> |
After the “?OpenAgent” you can pass paraments of course, which then needs to be parsed out. This whole technique lends itself very nicely to the proper way to Delete Domino Doc on the web
I’m not sure if I “borrowed” this for someone else years ago or invented myself. Part of the reason for posting this is so I don’t forget it.
Also Search Domino posted a similar tip to fill a more complicated need, from which I’m sure I can learn a few tricks.
Category:Domino