Subject: RE: Can JavaScript be embedded in LotusScript?
I think you’re running into issues that involve the differences between how things work on the web, and how they work in the Notes client. The Notes client has a lot of places where you can “attach” code to options. You can simulate this in Javascript & Java… but it’s not easy.
The Javascript running with an agent in the Notes client will never get to a web-browser… A web client generally doesn’t see agent output. (There are times when you might use that…but it’s not “the norm”.)
You have a list of command that it appears you’re running in the same event from the Notes client { @Command([ToolsRunMacro];“(AgentName”));@Command etc… etc…
The way those are strung together appears to me to be a “QueryClose” event on a Form.
A form on the web ignores anything in the QueryClose event. Instead you have to write an agent to do all that processing and call it in the WebQueryClose event using @Command([ToolsRunMacro];“AgentName”)
This agent is run on the current document after you click on something with " @Command([FileSave]);@Command([FileCloseWindow])" for an action.
If you wanted to use any “popup” type things, you can have your Notes code write pass-through HTML, or insert a Javascript header with whatever Javascript routines you want, and call the “openwindow” function in Javascript.
There are some good articles in the archived NotesR5 discussion group on here that I know of. I found it an invaluable resource when learning to write web-enabled Domino apps back in 2000.
The single biggest thing to keep in mind for writing web-enabled apps is that you CANNOT use any front-end classes… they just don’t work. You have to stick with backend classes.
(I tend to prefer sticking to the back-end classes as much as I can anyhow… it makes it easier to move from platform to platform… and code portability rocks.)
Oh… back to answering your main question… you can’t really embed Javascript in LotusScript for a web-browser. (You technically can, but it’s a bad idea.) You should be looking to embed the Javascript routines you need into the form as a combination of the Javascript header, computed text, and often you also need to use fields.
You can interchange data between Javascript and Notes fields on a form pretty easily… and you can access values on parent window documents from child windows (i.e. write “pop up” windows that will modify data on the “main” window. Or pop up a message in a window before saving the document.)
Domino relies heavily on Javascript in rendering things for the web… so it interchanges well.
I’m sorry if this response isn’t organized well. It’s midnight!